cft-builder 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cft-builder.js
CHANGED
package/dist/cft-builder.umd.cjs
CHANGED
|
@@ -4171,7 +4171,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4171
4171
|
* LICENSE.md file in the root directory of this source tree.
|
|
4172
4172
|
*
|
|
4173
4173
|
* @license MIT
|
|
4174
|
-
*/const Hxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Hxe.displayName="DataRouter");const zxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(zxe.displayName="DataRouterState");const Yxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Yxe.displayName="Await");const Kxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Kxe.displayName="Navigation");const Xxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Xxe.displayName="Location");const c$=y.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(c$.displayName="Route");const Rxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Rxe.displayName="RouteError");function u$(){let{matches:t}=y.useContext(c$),e=t[t.length-1];return e?e.params:{}}new Promise(()=>{});const Gxe=t=>{var r;const{section:e}=t,{userSelectedLanguage:n}=ln();return o.jsxs("div",{children:[" ",(r=e==null?void 0:e.heading)==null?void 0:r[n==null?void 0:n.type]," : "," ",o.jsx(Na,{placeholder:"enter weight",max:100,min:0}),o.jsx("br",{}),o.jsx("br",{})]})},Wxe=()=>{const[t]=N.useState([]);return N.useEffect(()=>()=>{},[]),o.jsx("div",{className:"card",children:(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((e,n)=>o.jsxs("div",{children:[o.jsx("ul",{className:"list-none p-0 m-0",children:o.jsxs("li",{className:"flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-3",style:{borderRadius:"10px"},children:[o.jsx("div",{children:o.jsxs("div",{children:[o.jsx("span",{className:"inline-flex justify-content-center align-items-center w-2rem h-2rem border-circle border-1",children:(e==null?void 0:e.is_active)===1?o.jsx("i",{style:{color:"green"},className:"pi pi-check"}):o.jsx("i",{className:"pi pi-check"})}),o.jsxs("span",{className:" font-bold ml-2",children:[e==null?void 0:e.version_name,(e==null?void 0:e.is_active)===1?" - Active ":""]})]})}),o.jsx("div",{className:"flex align-items-center justify-content-between md:justify-content-end mt-3 md:mt-0",children:o.jsx("div",{className:"text-right ml-3",children:o.jsx("span",{className:" font-bold",children:(e==null?void 0:e.is_active)===1?"":o.jsx(kt,{text:!0,onClick:()=>{setTimeout(()=>{},3e3)},severity:"success",label:"Make this version active",icon:"pi pi-check",size:"small"})})})})]})}),o.jsx("hr",{})]},`version-item-${n}`)))})},Qxe=()=>{const{setLayout:t,formBuilderConfigurationType:e}=ln(),n=N.useRef(null),r=s=>{var l;switch((l=s==null?void 0:s.formType)==null?void 0:l.key){case(e==null?void 0:e.key):t(s==null?void 0:s.layout);break}},i=async s=>{const l=s.target.files;if(l&&l.length>0){const c=await a(l[0]);r(c)}};async function a(s){return new Promise((l,c)=>{const u=new FileReader;u.onload=d=>{var f;return l(JSON.parse((f=d.target)==null?void 0:f.result))},u.onerror=d=>c(d),u.readAsText(s)})}return o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:n,type:"file",style:{display:"none"},id:"schema",name:"schema",onChange:i}),o.jsx(kt,{text:!0,size:"small",className:"p-button-primary ml-3 mr-3",onClick:()=>{var s;(s=n.current)==null||s.click()},label:"Import Template"})]})},Jxe=()=>{const{builderTemplateName:t,formBuilderFormSchema:e}=ln(),n=function(){const r=document.createElement("a");return function(i,a){const s=JSON.stringify(i),l=new Blob([s],{type:"octet/stream"}),c=window.URL.createObjectURL(l);r.href=c,r.download=a,r.click(),window.URL.revokeObjectURL(c)}}();return o.jsx(kt,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>{const r=e,i=t+".json";n(r,i)},label:"Export Template"})};function Og(){return Og=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Og.apply(this,arguments)}function Ng(t){"@babel/helpers - typeof";return Ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ng(t)}function Zxe(t,e){if(Ng(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ng(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eCe(t){var e=Zxe(t,"string");return Ng(e)==="symbol"?e:String(e)}function tCe(t,e,n){return e=eCe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nCe={root:function(e){var n=e.props,r=e.checked;return pt("p-inputswitch p-component",{"p-highlight":r,"p-disabled":n.disabled,"p-invalid":n.invalid})},input:"p-inputswitch-input",slider:"p-inputswitch-slider"},_5=Bn.extend({defaultProps:{__TYPE:"InputSwitch",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onBlur:null,onChange:null,onFocus:null,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,children:void 0},css:{classes:nCe}});function d$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rCe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?d$(Object(n),!0).forEach(function(r){tCe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ks=y.memo(y.forwardRef(function(t,e){var n=jn(),r=y.useContext(nr),i=_5.getProps(t,r),a=_5.setMetaData({props:i}),s=a.ptm,l=a.cx,c=a.isUnstyled;fi(_5.css.styles,c,{name:"inputswitch"});var u=y.useRef(null),d=y.useRef(i.inputRef),f=i.checked===i.trueValue,h=function(_){if(i.onChange){var T=f?i.falseValue:i.trueValue;i.onChange({originalEvent:_,value:T,stopPropagation:function(){_==null||_.stopPropagation()},preventDefault:function(){_==null||_.preventDefault()},target:{name:i.name,id:i.id,value:T}})}},m=function(_){var T;i==null||(T=i.onFocus)===null||T===void 0||T.call(i,_)},g=function(_){var T;i==null||(T=i.onBlur)===null||T===void 0||T.call(i,_)};y.useImperativeHandle(e,function(){return{props:i,focus:function(){return Ee.focus(d.current)},getElement:function(){return u.current},getInput:function(){return d.current}}}),y.useEffect(function(){Fe.combinedRefs(d,i.inputRef)},[d,i.inputRef]),Mi(function(){i.autoFocus&&Ee.focus(d.current,i.autoFocus)});var v=Fe.isNotEmpty(i.tooltip),A=_5.getOtherProps(i),w=Fe.reduceKeys(A,Ee.ARIA_PROPS),x=n({className:pt(i.className,l("root",{checked:f})),style:i.style,role:"checkbox","aria-checked":f,"data-p-highlight":f,"data-p-disabled":i.disabled},A,s("root")),S=n(rCe({type:"checkbox",id:i.inputId,name:i.name,checked:f,onChange:h,onFocus:m,onBlur:g,disabled:i.disabled,role:"switch",tabIndex:i.tabIndex,"aria-checked":f,className:l("input")},w),s("input")),E=n({className:l("slider")},s("slider"));return y.createElement(y.Fragment,null,y.createElement("div",Og({id:i.id,ref:u},x),y.createElement("input",Og({ref:d},S)),y.createElement("span",E)),v&&y.createElement(rn,Og({target:u,content:i.tooltip,pt:s("tooltip")},i.tooltipOptions)))}));Ks.displayName="InputSwitch";const iCe=()=>{var x,S,E,C,_;const{formBuilderFormSchema:t,selectFormBuilderLanguage:e,formBuilderSchemaLanguages:n,unselectFormBuilderLanguage:r,schemaBuilderUpdate:i,builderTemplateName:a,formBuilderLoading:s,formBuilderConfigurationType:l,saveFormTemplateNewVersion:c}=ln(),[u,d]=N.useState(),f=u$(),h=f==null?void 0:f.form_template_id,m=cb({initialValues:{firstName:"",lastName:"",contact:"",email:""},validate:()=>{const T={};return m.values.application_url="",T},onSubmit:()=>{}}),g=l==null?void 0:l.key,v=(T,O)=>{T!=null&&T.value?e(O):r(O),d(!u)},A=T=>{for(const[,O]of t.layout.entries())for(const[,F]of O.children.entries())for(const[,B]of F.children.entries())for(const[,M]of B.children.entries())for(const[,z]of M.children.entries())z.isFluid=T.value},w=()=>{MD({message:"Are you sure you want to a new version for this form?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{c(h,t)},reject:()=>{}})};return o.jsx(o.Fragment,{children:o.jsx("form",{onSubmit:m.handleSubmit,className:"p-fluid",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{height:"15rem"})}):o.jsxs(hi,{header:"General",children:[o.jsxs("h5",{children:["Form Title : ",a||""," "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"binary",onChange:T=>{i({showIntroTab:T.value})},checked:t==null?void 0:t.showIntroTab}),o.jsx("label",{htmlFor:"binary",children:"Show Intro Page"})," "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({enableAutoSave:T.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Task Render Form User Data"})]}),g===N7&&o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({surveyQuestionSlide:T.value})},checked:t==null?void 0:t.surveyQuestionSlide}),o.jsx("label",{htmlFor:"auto-save",children:"Survey Slide Per Question"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"showConditionalFields",onChange:T=>{i({showConditionalFields:T.value})},checked:t==null?void 0:t.showConditionalFields,disabled:t==null?void 0:t.surveyQuestionSlide}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Show Conditional Fields ",(t==null?void 0:t.surveyQuestionSlide)===!0&&o.jsx("small",{className:"error",children:"Cant use Survey Slide Per Question with Conditional Fields"})]})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"enableReviewTask",onChange:T=>{i({enableReviewTask:T.value})},checked:t==null?void 0:t.enableReviewTask}),o.jsx("label",{htmlFor:"enableReviewTask",children:"Enable Admin Review Task"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"enableFormFluid",onChange:T=>{i({enableFormFluid:T.value}),A(T)},checked:t==null?void 0:t.enableFormFluid}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Form Fluid"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"enableFieldEnumeration",onChange:T=>{i({enableFieldEnumeration:T.value}),A(T)},checked:t==null?void 0:t.enableFieldEnumeration}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Field Enumeration"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"isOnboardingForm",onChange:T=>{i({isOnboardingForm:T.value}),A(T)},checked:t==null?void 0:t.isOnboardingForm}),o.jsx("label",{htmlFor:"isOnboardingForm",children:"Is Onboarding Form"})]})]}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"8rem"})}):o.jsxs(hi,{className:"mt-3",header:"Auto Save Settings",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({enableAutoSave:T.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save User Data"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({enableAutoSaveBuilderSetting:T.value})},checked:t==null?void 0:t.enableAutoSaveBuilderSetting}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Form Builder Settings"})]})]}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"16rem"})}):o.jsxs(hi,{className:"mt-3",header:"Form Table Configuration",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"stripedRows",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,stripedRows:T.value}})},checked:(x=t==null?void 0:t.tableConfiguration)==null?void 0:x.stripedRows}),o.jsx("label",{htmlFor:"stripedRows",children:"Striped Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"gridLines",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,gridLines:T.value}})},checked:(S=t==null?void 0:t.tableConfiguration)==null?void 0:S.gridLines}),o.jsx("label",{htmlFor:"gridLines",children:"Grid Lines"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"flexScroll",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,flexScroll:T.value}})},checked:(E=t==null?void 0:t.tableConfiguration)==null?void 0:E.flexScroll}),o.jsx("label",{htmlFor:"flexScroll",children:"Flex Scroll "})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"isResponsive",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,isResponsive:T.value}})},checked:(C=t==null?void 0:t.tableConfiguration)==null?void 0:C.isResponsive}),o.jsx("label",{htmlFor:"isResponsive",children:"isResponsive Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"rowReorder",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,rowReorder:T.value}})},checked:(_=t==null?void 0:t.tableConfiguration)==null?void 0:_.rowReorder}),o.jsx("label",{htmlFor:"rowReorder",children:"Row Reorder"})]})]})]}),o.jsxs("div",{className:"col-6",children:[s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{height:"18rem"})}):o.jsx(hi,{header:"Languages",children:iQ.map((T,O)=>{const F=n.filter(function(B){return(T==null?void 0:T.key)===(B==null?void 0:B.key)});return o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:O,name:"lagnuage",checked:F.length>0,onChange:B=>v(B,T)}),o.jsx("label",{htmlFor:O,children:T.language})]},O)})}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"16rem"})}):o.jsxs(hi,{className:"mt-3",header:"Versioning",children:[o.jsx("h5",{children:"Change Form Version Title"}),o.jsx("div",{className:"field",children:o.jsx(gn,{value:(t==null?void 0:t.version_name)||"",minLength:2,placeholder:"Enter form version",maxLength:50,onChange:T=>{var O;i({version_name:(O=T==null?void 0:T.target)==null?void 0:O.value})}})}),o.jsx("h5",{children:"All Forms Version"}),o.jsx(Wxe,{}),o.jsx(kt,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>w(),label:"Create New Version",loading:s})]}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"8rem"})}):o.jsx(hi,{className:"mt-3",header:"Export/Import",children:o.jsxs("span",{className:"flex",children:[o.jsx(Jxe,{}),o.jsx(Qxe,{})]})})]}),o.jsx("div",{className:"col-6"})]})})})},aCe=t=>{var g,v,A;const{fieldIndex:e,field:n,models:r,setfieldMappings:i,fieldMappings:a}=t,[s,l]=N.useState(null),[c,u]=N.useState(null),d=()=>{var S;const w=[...a],x=w.findIndex(E=>E.fieldId===(n==null?void 0:n.uuid));if(x!==-1){const E=[...r],C=E.findIndex(_=>{var T;return _.modelName===((T=w[x])==null?void 0:T.modelName)});u((S=w[x])==null?void 0:S.column_name),C!==-1&&l(E[C])}};N.useEffect(()=>(d(),()=>{}),[]);const[f,h]=N.useState(!1),m=w=>{const x=[...a],S=x.findIndex(C=>C.fieldId===w),E={fieldId:w,modelName:(s==null?void 0:s.modelName)||"",class:s==null?void 0:s.class,column_name:c||""};S!==-1?x[S]=E:x.push(E),i([...x])};return o.jsxs("div",{className:"grid",children:[o.jsxs(As,{header:`Map ${(g=n==null?void 0:n.label)==null?void 0:g.english} Field with Model`,visible:f,style:{width:"40vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsx(kt,{text:!0,label:"Set Field","aria-label":"Submit",onClick:()=>{m((n==null?void 0:n.uuid)||""),h(!1)}})}),onHide:()=>h(!1),children:[o.jsxs("p",{children:["Map ",(v=n==null?void 0:n.label)==null?void 0:v.english," Field with Model"]}),o.jsxs("div",{className:"flex justify-content-between",children:[o.jsx(xa,{value:s,onChange:w=>l(w.value),options:r,optionLabel:"modelName",className:"w-full md:w-14rem",placeholder:"Select a model field",filter:!0,showClear:!0}),o.jsx(xa,{value:c,onChange:w=>u(w.value),options:(s==null?void 0:s.columns)||[],className:"w-full md:w-14rem",placeholder:"Select a column",filter:!0,showClear:!0})]})]}),o.jsx("div",{className:"col-6",children:o.jsxs("p",{children:[o.jsxs("strong",{children:[e+1," "]}),"Field ",n==null?void 0:n.componentType,": ",(A=n==null?void 0:n.label)==null?void 0:A.english," Is Mapped to"," ",o.jsx(_c,{className:"mr-2",severity:s!=null&&s.modelName?"success":"warning",value:(s==null?void 0:s.modelName)||"Nothing"}),"with column"," ",o.jsx(_c,{className:"mr-2",severity:c?"success":"danger",value:c||"Nothing"})]})}),o.jsx("div",{className:"col-6",children:o.jsx(kt,{text:!0,label:"Set Model","aria-label":"Submit",onClick:()=>{h(!0)}})})]},e+"-table-field-item")},sCe=t=>{const{fields:e}=t,[n]=N.useState([]),[r,i]=N.useState(!1),{formBuilderFormSchema:a,schemaBuilderUpdate:s}=ln(),l=()=>{i(!0)},c=()=>{let d=[...(a==null?void 0:a.fieldMappings)||[]];console.log("tempFieldsMappings",d),d!=null&&d.length&&(d=d==null?void 0:d.filter(f=>e.some(h=>h.uuid===(f==null?void 0:f.fieldId)))),u(d)};N.useEffect(()=>(l(),c(),()=>{}),[]);const u=d=>{s({fieldMappings:d})};return o.jsx("div",{children:r===!0?o.jsxs(o.Fragment,{children:[o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"})]}):o.jsx(o.Fragment,{children:(e==null?void 0:e.length)>0&&(n==null?void 0:n.length)>0&&(e==null?void 0:e.map((d,f)=>o.jsx("div",{className:"card",children:o.jsx(aCe,{fieldMappings:a!=null&&a.fieldMappings?a==null?void 0:a.fieldMappings:[],setfieldMappings:u,field:d,fieldIndex:f,models:n})},f+"-table-field-itemc-component")))})})},oCe=0,lCe=t=>{const{setShowPreview:e,activeIndex:n,userFormBuilderSettings:r}=t,{builderIsChangesSaved:i,builderTemplateName:a,formBuilderConfigurationType:s,formBuilderFormSchema:l,formBuilderLoading:c,formBuilderPublishedStatus:u,builderVersionName:d,saveFormProgress:f,schemaBuilderUpdate:h}=ln(),m=N.useRef(null),g=()=>{f(l)},v=["Basic","Advanced"],[A,w]=N.useState((r==null?void 0:r.isAdvanceView)!==void 0&&r!=null&&r.isAdvanceView?"Advanced":"Basic"),x=C=>{w(C.value),h({isAdvanceView:C.value==="Advanced"})},S=o.jsx(N.Fragment,{children:o.jsxs("div",{className:"flex",children:[((s==null?void 0:s.key)===O7||(s==null?void 0:s.key)===N7||(s==null?void 0:s.key)===tse)&&o.jsx(q0,{className:"mr-3",value:A,onChange:C=>x(C),options:v,disabled:c}),o.jsx(kt,{text:!0,icon:"pi pi-eye",size:"small",className:"mr-2",onClick:()=>e(!0),label:"Preview"}),!u&&o.jsx(o.Fragment,{children:(l==null?void 0:l.enableAutoSaveBuilderSetting)===!1&&o.jsx(kt,{text:!0,disabled:i,size:"small",className:i?"p-button-secondary":"p-button-info",onClick:()=>g(),label:"Save Progress",loading:c})})]})}),E=o.jsx(N.Fragment,{children:c===!0?o.jsx(o.Fragment,{children:o.jsx(da,{width:"25rem",height:"1.5rem"})}):o.jsxs("div",{className:"font-medium text-900",children:["Builder - ",s==null?void 0:s.name," - ",a," ","- Version : ",d]})});return o.jsxs(o.Fragment,{children:[o.jsx(i3,{ref:m}),o.jsxs("div",{className:"flex",children:[o.jsx("div",{className:"flex w-5 justify-content-left align-items-start",children:E}),o.jsx("div",{className:"flex w-7 justify-content-right align-items-end",children:n===oCe&&S})]})]})};function cCe(){const{formBuilderFormLayout:t,formBuilderFormSchema:e,clearBuilderSchema:n,schemaBuilderUpdate:r,saveFormProgress:i,userSelectedLanguage:a,builderIsChangesSaved:s}=ln(),l=u$(),c=l==null?void 0:l.form_template_id,[u]=N.useState(!0),[d]=N.useState(null),[f,h]=N.useState(!0),[m,g]=N.useState(!1),[v,A]=N.useState(0),[w,x]=N.useState(null),S=async()=>{},E=N.useCallback(()=>{S()},[t,e]),C=O=>{const F={...e,intro:O};r(F)},_=()=>{i(e)},T=()=>{s===!1?MD({message:"You have unsaved changes, would you like to to save them or discard them?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{_(),h(!1),setTimeout(()=>{n()},1e3)},rejectLabel:"Close and discard changes",acceptLabel:"Close and save changes",reject:()=>{h(!1),setTimeout(()=>{n()},1e3)}}):(h(!1),setTimeout(()=>{n()},1e3))};return o.jsx(As,{maximizable:!0,header:()=>o.jsx(lCe,{setUserFormBuilderSettings:x,userFormBuilderSettings:w,formBuilderFormLayout:t,formTemplateId:c,showPreview:m,setShowPreview:g,activeIndex:v,emitSocketData:E}),visible:f,style:{width:"100vw",height:"100vh",maxHeight:"100%"},onHide:()=>T(),children:o.jsxs("div",{id:"form-builder",className:"grid",style:{overflow:"hidden",height:"100%"},children:[!u&&o.jsx(kt,{text:!0,label:"Request Access",onClick:()=>{},className:"p-button-info"}),d&&o.jsxs("div",{children:[d==null?void 0:d.username," is editing so you have to wait to edits and leaves."]}),o.jsx("div",{className:"flex justify-content-end"}),o.jsx("div",{id:"users-arrow"}),o.jsx("div",{className:"col-12",style:{overflow:"hidden"},children:o.jsxs(Ka,{activeIndex:v,onTabChange:O=>A(O.index),children:[o.jsxs(hr,{header:"Builder",children:[o.jsx(sf,{backend:lf}),o.jsx(Io,{style:{width:"75vw"},visible:m,onHide:()=>g(!1),position:"right",children:o.jsx(sf,{backend:lf,children:o.jsx("div",{className:"scroll-height-200"})})})]}),o.jsx(hr,{header:"Configuration",children:o.jsx("div",{className:"scroll-height-250",children:o.jsx(iCe,{})})}),o.jsx(hr,{header:"Intro",disabled:(e==null?void 0:e.showIntroTab)===!1,children:o.jsx(u4,{style:{height:"320px"},value:(e==null?void 0:e.intro)||"<p></p>",onTextChange:O=>{C(O==null?void 0:O.htmlValue)}})}),o.jsx(hr,{header:"Data Model Binding",children:o.jsx(sCe,{fields:e==null?void 0:e.tableFields})}),o.jsxs(hr,{header:"Weighting",children:[o.jsx("h3",{children:"Weighting"}),(t==null?void 0:t.length)>0&&t.map((O,F)=>{var B,M,z;return o.jsxs("div",{children:[o.jsx("h5",{children:(B=O==null?void 0:O.title)==null?void 0:B[a==null?void 0:a.type]}),((M=O==null?void 0:O.children)==null?void 0:M.length)>0&&((z=O==null?void 0:O.children)==null?void 0:z.map((P,H)=>o.jsx("div",{children:o.jsx(Gxe,{page:O,section:P})},`weighting-section-${H}`)))]},`weighting-page-${F}`)}),o.jsx("hr",{}),"Total ",o.jsx(Na,{placeholder:"0",readOnly:!0})," %"]})]})})]})})}const uCe=()=>o.jsx(cCe,{}),dCe=t=>{const{className:e=""}=t,{builderIsChangesSaved:n,schemaBuilderUpdate:r,formBuilderFormLayout:i,formBuilderFormSchema:a,formatTableFieldsHook:s,formBuilderLoading:l,saveFormProgress:c}=ln(),u=d=>{n===!1?(d.preventDefault(),d.returnValue=!1):window.location.reload()};return N.useEffect(()=>(window.addEventListener("beforeunload",u),()=>{window.removeEventListener("beforeunload",u)}),[n]),N.useEffect(()=>((a==null?void 0:a.enableAutoSaveBuilderSetting)===!0&&l===!1?c(!1):r({isChangesSaved:!1}),s(i),()=>{}),[i]),o.jsx("div",{className:e,children:o.jsx(E5,{})})},fCe={padding:"1rem 0.5rem",cursor:"move",textAlign:"center"},Dh=t=>{const{data:e,showIcon:n,tags:r}=t,[{opacity:i},a]=Ji({type:tr,item:e,collect:l=>({opacity:l.isDragging()?0:1})});function s(l,c){return l.length<=c?l:l.slice(0,c)+"..."}return o.jsxs("div",{ref:a,className:`card shadow-2 question builder-sidebar-item ${e==null?void 0:e.element}`,style:{...fCe,opacity:i},children:[i&&(e!=null&&e.toolTip)?e==null?void 0:e.toolTip(e):"",s(e==null?void 0:e.label,80),o.jsxs("div",{className:"mt-2",children:[n&&o.jsx(_c,{icon:"pi pi-check",severity:"warning",className:"mr-2",rounded:!0}),r&&o.jsx(o.Fragment,{children:(r==null?void 0:r.length)>0&&(r==null?void 0:r.map((l,c)=>o.jsx(_c,{severity:l==null?void 0:l.severity,className:"mr-2",value:l==null?void 0:l.label},`tagIndex-${c}`)))})]})]})},hCe=()=>{const{renderType:t}=tn();return o.jsx(o.Fragment,{children:o.jsxs(Ka,{tabIndex:0,children:[t===Jh&&o.jsx(hr,{header:"Survey",children:tQ.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===H1||t===dm)&&o.jsx(hr,{header:"Form",children:ZW.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===I9||t===jC||t===Zh)&&o.jsx(hr,{header:"Layout",children:RY.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===Jh||t===H1||t===dm)&&o.jsx(hr,{header:"Layout",children:eQ.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),t===ep&&o.jsx(hr,{header:"Question Bank",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-12",children:XY.map((e,n)=>o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>{const a=Et.cloneDeep(r);return o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:a},r.uuid)},"form_elements_"+i)})},`new-quiz-${n}`))}),o.jsx("div",{className:"col-12 ",children:o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(gn,{placeholder:"Keyword"}),o.jsx(kt,{icon:"pi pi-search",className:"p-button-info"})]})})]})}),t===_9&&o.jsx(hr,{header:"Training",children:nQ.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===Jh||t===H1||t===dm)&&o.jsxs(hr,{header:"Custom",children:[o.jsx("h6",{children:"Custom Sections"}),o.jsx("div",{className:"grid"}),o.jsx("h6",{children:"Custom Matrix"}),o.jsx("div",{className:"grid"})]})]})})};function f$(t){return t}function pCe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var gCe=800,mCe=16,vCe=Date.now;function bCe(t){var e=0,n=0;return function(){var r=vCe(),i=mCe-(r-n);if(n=r,i>0){if(++e>=gCe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function yCe(t){return function(){return t}}var ACe=X3?function(t,e){return X3(t,"toString",{configurable:!0,enumerable:!1,value:yCe(e),writable:!0})}:f$,wCe=bCe(ACe),h$=Math.max;function SCe(t,e,n){return e=h$(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=h$(r.length-e,0),s=Array(a);++i<a;)s[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=n(s),pCe(t,this,l)}}function xCe(t,e){return wCe(SCe(t,e,f$),t+"")}function CCe(t,e,n){if(!e0(n))return!1;var r=typeof e;return(r=="number"?R3(n)&&CN(e,n.length):r=="string"&&e in n)?l2(n[e],t):!1}function TCe(t){return xCe(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&CCe(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var l=n[r];l&&t(e,l,r,a)}return e})}var ECe="__lodash_hash_undefined__";function ICe(t){return this.__data__.set(t,ECe),this}function _Ce(t){return this.__data__.has(t)}function D5(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new od;++e<n;)this.add(t[e])}D5.prototype.add=D5.prototype.push=ICe,D5.prototype.has=_Ce;function DCe(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function OCe(t,e){return t.has(e)}var NCe=1,FCe=2;function p$(t,e,n,r,i,a){var s=n&NCe,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,m=n&FCe?new D5:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var g=t[f],v=e[f];if(r)var A=s?r(v,g,f,e,t,a):r(g,v,f,t,e,a);if(A!==void 0){if(A)continue;h=!1;break}if(m){if(!DCe(e,function(w,x){if(!OCe(m,x)&&(g===w||i(g,w,n,r,a)))return m.push(x)})){h=!1;break}}else if(!(g===v||i(g,v,n,r,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function kCe(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function PCe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var MCe=1,LCe=2,BCe="[object Boolean]",VCe="[object Date]",UCe="[object Error]",qCe="[object Map]",jCe="[object Number]",$Ce="[object RegExp]",HCe="[object Set]",zCe="[object String]",YCe="[object Symbol]",KCe="[object ArrayBuffer]",XCe="[object DataView]",g$=cu?cu.prototype:void 0,wS=g$?g$.valueOf:void 0;function RCe(t,e,n,r,i,a,s){switch(n){case XCe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case KCe:return!(t.byteLength!=e.byteLength||!a(new G3(t),new G3(e)));case BCe:case VCe:case jCe:return l2(+t,+e);case UCe:return t.name==e.name&&t.message==e.message;case $Ce:case zCe:return t==e+"";case qCe:var l=kCe;case HCe:var c=r&MCe;if(l||(l=PCe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=LCe,s.set(t,e);var d=p$(l(t),l(e),r,i,a,s);return s.delete(t),d;case YCe:if(wS)return wS.call(t)==wS.call(e)}return!1}var GCe=1,WCe=Object.prototype,QCe=WCe.hasOwnProperty;function JCe(t,e,n,r,i,a){var s=n&GCe,l=J7(t),c=l.length,u=J7(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:QCe.call(e,h)))return!1}var m=a.get(t),g=a.get(e);if(m&&g)return m==e&&g==t;var v=!0;a.set(t,e),a.set(e,t);for(var A=s;++f<c;){h=l[f];var w=t[h],x=e[h];if(r)var S=s?r(x,w,h,e,t,a):r(w,x,h,t,e,a);if(!(S===void 0?w===x||i(w,x,n,r,a):S)){v=!1;break}A||(A=h=="constructor")}if(v&&!A){var E=t.constructor,C=e.constructor;E!=C&&"constructor"in t&&"constructor"in e&&!(typeof E=="function"&&E instanceof E&&typeof C=="function"&&C instanceof C)&&(v=!1)}return a.delete(t),a.delete(e),v}var ZCe=1,m$="[object Arguments]",v$="[object Array]",O5="[object Object]",eTe=Object.prototype,b$=eTe.hasOwnProperty;function tTe(t,e,n,r,i,a){var s=ld(t),l=ld(e),c=s?v$:g2(t),u=l?v$:g2(e);c=c==m$?O5:c,u=u==m$?O5:u;var d=c==O5,f=u==O5,h=c==u;if(h&&f2(t)){if(!f2(e))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new du),s||X7(t)?p$(t,e,n,r,i,a):RCe(t,e,c,n,r,i,a);if(!(n&ZCe)){var m=d&&b$.call(t,"__wrapped__"),g=f&&b$.call(e,"__wrapped__");if(m||g){var v=m?t.value():t,A=g?e.value():e;return a||(a=new du),i(v,A,n,r,a)}}return h?(a||(a=new du),JCe(t,e,n,r,i,a)):!1}function y$(t,e,n,r,i){return t===e?!0:t==null||e==null||!uu(t)&&!uu(e)?t!==t&&e!==e:tTe(t,e,n,r,y$,i)}function nTe(t){return function(e,n,r){for(var i=-1,a=Object(e),s=r(e),l=s.length;l--;){var c=s[t?l:++i];if(n(a[c],c,a)===!1)break}return e}}var rTe=nTe();function SS(t,e,n){(n!==void 0&&!l2(t[e],n)||n===void 0&&!(e in t))&&H7(t,e,n)}function iTe(t){return uu(t)&&R3(t)}function xS(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function aTe(t){return d2(t,p2(t))}function sTe(t,e,n,r,i,a,s){var l=xS(t,n),c=xS(e,n),u=s.get(c);if(u){SS(t,n,u);return}var d=a?a(l,c,n+"",t,e,s):void 0,f=d===void 0;if(f){var h=ld(c),m=!h&&f2(c),g=!h&&!m&&X7(c);d=c,h||m||g?ld(l)?d=l:iTe(l)?d=W7(l):m?(f=!1,d=kN(c,!0)):g?(f=!1,d=KN(c,!0)):d=[]:q7(c)||z7(c)?(d=l,z7(l)?d=aTe(l):(!e0(l)||j7(l))&&(d=RN(c))):f=!1}f&&(s.set(c,d),i(d,c,r,a,s),s.delete(c)),SS(t,n,d)}function A$(t,e,n,r,i){t!==e&&rTe(e,function(a,s){if(i||(i=new du),e0(a))sTe(t,e,s,n,A$,r,i);else{var l=r?r(xS(t,s),a,s+"",t,e,i):void 0;l===void 0&&(l=a),SS(t,s,l)}},p2)}function CS(t,e){return y$(t,e)}var m0=TCe(function(t,e,n){A$(t,e,n)}),ir=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(ir||{});class Ou{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const i=ir.TYPE&ir.ATTRIBUTE;this.scope=r.scope!=null?r.scope&ir.LEVEL|i:ir.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Oh extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const w$=class oC{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const i=this.query(n);if(i==null)throw new Oh(`Unable to create ${n} blot`);const a=i,s=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),l=new a(e,s,r);return oC.blots.set(l.domNode,l),l}find(e,n=!1){return oC.find(e,n)}query(e,n=ir.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&ir.LEVEL&ir.BLOCK?r=this.types.block:e&ir.LEVEL&ir.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&ir.LEVEL&r.scope&&n&ir.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,i="attrName"in n;if(!r&&!i)throw new Oh("Invalid definition");if(r&&n.blotName==="abstract")throw new Oh("Cannot register abstract class");const a=r?n.blotName:i?n.attrName:void 0;return this.types[a]=n,i?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(s=>s.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(s=>{(this.tags[s]==null||n.className==null)&&(this.tags[s]=n)}))),n})}};w$.blots=new WeakMap;let Nh=w$;function S$(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class oTe extends Ou{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){S$(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(S$(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const $c=oTe;function TS(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class lTe extends Ou{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[TS(this.keyName)]=n,!0):!1}remove(e){e.style[TS(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[TS(this.keyName)];return this.canAdd(e,n)?n:""}}const v0=lTe;class cTe{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Nh.find(this.domNode);if(e==null)return;const n=Ou.keys(this.domNode),r=$c.keys(this.domNode),i=v0.keys(this.domNode);n.concat(r).concat(i).forEach(a=>{const s=e.scroll.query(a,ir.ATTRIBUTE);s instanceof Ou&&(this.attributes[s.attrName]=s)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const N5=cTe,x$=class{constructor(e,n){this.scroll=e,this.domNode=n,Nh.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Oh("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Nh.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,i){const a=this.isolate(e,n);if(this.scroll.query(r,ir.BLOT)!=null&&i)a.wrap(r,i);else if(this.scroll.query(r,ir.ATTRIBUTE)!=null){const s=this.scroll.create(this.statics.scope);a.wrap(s),s.format(r,i)}}insertAt(e,n,r){const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(i,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Oh(`Cannot wrap ${e}`);return r.appendChild(this),r}};x$.blotName="abstract";let C$=x$;const T$=class extends C${static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};T$.scope=ir.INLINE_BLOT;const fo=T$;class uTe{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),i=0;for(;r;){if(r===e)return i;i+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let i=r();for(;i;){const a=i.length();if(e<a||n&&e===a&&(i.next==null||i.next.length()!==0))return[i,e];e-=a,i=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[i,a]=this.find(e);let s=e-a;const l=this.iterator(i);let c=l();for(;c&&s<e+n;){const u=c.length();e>s?r(c,e-s,Math.min(n,s+u-e)):r(c,0,Math.min(u,e+n-s)),s+=u,c=l()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let i=r();for(;i;)n=e(n,i),i=r();return n}}function E$(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(ir.INLINE);return Array.from(t.childNodes).forEach(i=>{r.domNode.appendChild(i)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const I$=class N0 extends C${constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,N0.uiClass&&this.uiNode.classList.add(N0.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new uTe,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=E$(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Oh)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,i,a)=>{r.deleteAt(i,a)})}descendant(e,n=0){const[r,i]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof N0?r.descendant(e,i):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(s,l,c)=>{(e.blotName==null&&e(s)||e.blotName!=null&&s instanceof e)&&i.push(s),s instanceof N0&&(i=i.concat(s.descendants(e,l,a))),a-=c}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===ir.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof N0?n.unwrap():n.remove())})}formatAt(e,n,r,i){this.children.forEachAt(e,n,(a,s,l)=>{a.formatAt(s,l,r,i)})}insertAt(e,n,r){const[i,a]=this.children.find(e);if(i)i.insertAt(a,n,r);else{const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(s)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,i]=this.children.find(e,n),a=[[this,e]];return r instanceof N0?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof N0&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,a,s)=>{const l=i.split(a,n);l!=null&&r.appendChild(l)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],i=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),i.push(...a.removedNodes))}),i.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const s=this.scroll.find(a);s!=null&&(s.domNode.parentNode==null||s.domNode.parentNode===this.domNode)&&s.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,s)=>a===s?0:a.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let s=null;a.nextSibling!=null&&(s=this.scroll.find(a.nextSibling));const l=E$(a,this.scroll);(l.next!==s||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,s||void 0))}),this.enforceAllowedChildren()}};I$.uiClass="";const Hc=I$;function dTe(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const Fh=class Qh extends Hc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Qh.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new N5(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof Qh||(r=r.wrap(Qh.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,ir.INLINE);if(r==null)return;r instanceof Ou?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.formats()[r]!=null||this.scroll.query(r,ir.ATTRIBUTE)?this.isolate(e,n).format(r,i):super.formatAt(e,n,r,i)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof Qh&&r.prev===this&&dTe(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof Qh&&this.attributes.move(r),r}};Fh.allowedChildren=[Fh,fo],Fh.blotName="inline",Fh.scope=ir.INLINE_BLOT,Fh.tagName="SPAN";const ES=Fh,kh=class lC extends Hc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(lC.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new N5(this.domNode)}format(e,n){const r=this.scroll.query(e,ir.BLOCK);r!=null&&(r instanceof Ou?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(lC.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.scroll.query(r,ir.BLOCK)!=null?this.format(r,i):super.formatAt(e,n,r,i)}insertAt(e,n,r){if(r==null||this.scroll.query(n,ir.INLINE)!=null)super.insertAt(e,n,r);else{const i=this.split(e);if(i!=null){const a=this.scroll.create(n,r);i.parent.insertBefore(a,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};kh.blotName="block",kh.scope=ir.BLOCK_BLOT,kh.tagName="P",kh.allowedChildren=[ES,kh,fo];const Fg=kh,IS=class extends Hc{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,i){super.formatAt(e,n,r,i),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};IS.blotName="container",IS.scope=ir.BLOCK_BLOT;const F5=IS;class fTe extends fo{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,i){e===0&&n===this.length()?this.format(r,i):super.formatAt(e,n,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Cl=fTe,hTe={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},pTe=100,Ph=class extends Hc{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,hTe),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=ir.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,i){this.update(),super.formatAt(e,n,r,i)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const a=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&a(c.parent))},s=c=>{r.has(c.domNode)&&(c instanceof Hc&&c.children.forEach(s),r.delete(c.domNode),c.optimize(n))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=pTe)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const d=this.find(u.target,!0);d!=null&&(d.domNode===u.target&&(u.type==="childList"?(a(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(f=>{const h=this.find(f,!1);a(h,!1),h instanceof Hc&&h.children.forEach(m=>{a(m,!1)})})):u.type==="attributes"&&a(d.prev)),a(d))}),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const a=this.find(i.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(i),null):(r.set(a.domNode,[i]),a)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};Ph.blotName="scroll",Ph.defaultChild=Fg,Ph.allowedChildren=[Fg,F5],Ph.scope=ir.BLOCK_BLOT,Ph.tagName="DIV";const _S=Ph,DS=class yY extends fo{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof yY&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};DS.blotName="text",DS.scope=ir.INLINE_BLOT;const k5=DS,_$=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Ou,AttributorStore:N5,BlockBlot:Fg,ClassAttributor:$c,ContainerBlot:F5,EmbedBlot:Cl,InlineBlot:ES,LeafBlot:fo,ParentBlot:Hc,Registry:Nh,Scope:ir,ScrollBlot:_S,StyleAttributor:v0,TextBlot:k5},Symbol.toStringTag,{value:"Module"}));var OS={exports:{}},Tl=-1,Mo=1,Ss=0;function kg(t,e,n,r,i){if(t===e)return t?[[Ss,t]]:[];if(n!=null){var a=xTe(t,e,n);if(a)return a}var s=NS(t,e),l=t.substring(0,s);t=t.substring(s),e=e.substring(s),s=P5(t,e);var c=t.substring(t.length-s);t=t.substring(0,t.length-s),e=e.substring(0,e.length-s);var u=gTe(t,e);return l&&u.unshift([Ss,l]),c&&u.push([Ss,c]),FS(u,i),r&&bTe(u),u}function gTe(t,e){var n;if(!t)return[[Mo,e]];if(!e)return[[Tl,t]];var r=t.length>e.length?t:e,i=t.length>e.length?e:t,a=r.indexOf(i);if(a!==-1)return n=[[Mo,r.substring(0,a)],[Ss,i],[Mo,r.substring(a+i.length)]],t.length>e.length&&(n[0][0]=n[2][0]=Tl),n;if(i.length===1)return[[Tl,t],[Mo,e]];var s=vTe(t,e);if(s){var l=s[0],c=s[1],u=s[2],d=s[3],f=s[4],h=kg(l,u),m=kg(c,d);return h.concat([[Ss,f]],m)}return mTe(t,e)}function mTe(t,e){for(var n=t.length,r=e.length,i=Math.ceil((n+r)/2),a=i,s=2*i,l=new Array(s),c=new Array(s),u=0;u<s;u++)l[u]=-1,c[u]=-1;l[a+1]=0,c[a+1]=0;for(var d=n-r,f=d%2!==0,h=0,m=0,g=0,v=0,A=0;A<i;A++){for(var w=-A+h;w<=A-m;w+=2){var x=a+w,S;w===-A||w!==A&&l[x-1]<l[x+1]?S=l[x+1]:S=l[x-1]+1;for(var E=S-w;S<n&&E<r&&t.charAt(S)===e.charAt(E);)S++,E++;if(l[x]=S,S>n)m+=2;else if(E>r)h+=2;else if(f){var C=a+d-w;if(C>=0&&C<s&&c[C]!==-1){var _=n-c[C];if(S>=_)return D$(t,e,S,E)}}}for(var T=-A+g;T<=A-v;T+=2){var C=a+T,_;T===-A||T!==A&&c[C-1]<c[C+1]?_=c[C+1]:_=c[C-1]+1;for(var O=_-T;_<n&&O<r&&t.charAt(n-_-1)===e.charAt(r-O-1);)_++,O++;if(c[C]=_,_>n)v+=2;else if(O>r)g+=2;else if(!f){var x=a+d-T;if(x>=0&&x<s&&l[x]!==-1){var S=l[x],E=a+S-x;if(_=n-_,S>=_)return D$(t,e,S,E)}}}}return[[Tl,t],[Mo,e]]}function D$(t,e,n,r){var i=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=kg(i,a),u=kg(s,l);return c.concat(u)}function NS(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(a,i)==e.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return P$(t.charCodeAt(i-1))&&i--,i}function O$(t,e){var n=t.length,r=e.length;if(n==0||r==0)return 0;n>r?t=t.substring(n-r):n<r&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var a=0,s=1;;){var l=t.substring(i-s),c=e.indexOf(l);if(c==-1)return a;s+=c,(c==0||t.substring(i-s)==e.substring(0,s))&&(a=s,s++)}}function P5(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(t.length-i,t.length-a)==e.substring(e.length-i,e.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return M$(t.charCodeAt(t.length-i))&&i--,i}function vTe(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||r.length*2<n.length)return null;function i(m,g,v){for(var A=m.substring(v,v+Math.floor(m.length/4)),w=-1,x="",S,E,C,_;(w=g.indexOf(A,w+1))!==-1;){var T=NS(m.substring(v),g.substring(w)),O=P5(m.substring(0,v),g.substring(0,w));x.length<O+T&&(x=g.substring(w-O,w)+g.substring(w,w+T),S=m.substring(0,v-O),E=m.substring(v+T),C=g.substring(0,w-O),_=g.substring(w+T))}return x.length*2>=m.length?[S,E,C,_,x]:null}var a=i(n,r,Math.ceil(n.length/4)),s=i(n,r,Math.ceil(n.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var c,u,d,f;t.length>e.length?(c=l[0],u=l[1],d=l[2],f=l[3]):(d=l[0],f=l[1],c=l[2],u=l[3]);var h=l[4];return[c,u,d,f,h]}function bTe(t){for(var e=!1,n=[],r=0,i=null,a=0,s=0,l=0,c=0,u=0;a<t.length;)t[a][0]==Ss?(n[r++]=a,s=c,l=u,c=0,u=0,i=t[a][1]):(t[a][0]==Mo?c+=t[a][1].length:u+=t[a][1].length,i&&i.length<=Math.max(s,l)&&i.length<=Math.max(c,u)&&(t.splice(n[r-1],0,[Tl,i]),t[n[r-1]+1][0]=Mo,r--,r--,a=r>0?n[r-1]:-1,s=0,l=0,c=0,u=0,i=null,e=!0)),a++;for(e&&FS(t),wTe(t),a=1;a<t.length;){if(t[a-1][0]==Tl&&t[a][0]==Mo){var d=t[a-1][1],f=t[a][1],h=O$(d,f),m=O$(f,d);h>=m?(h>=d.length/2||h>=f.length/2)&&(t.splice(a,0,[Ss,f.substring(0,h)]),t[a-1][1]=d.substring(0,d.length-h),t[a+1][1]=f.substring(h),a++):(m>=d.length/2||m>=f.length/2)&&(t.splice(a,0,[Ss,d.substring(0,m)]),t[a-1][0]=Mo,t[a-1][1]=f.substring(0,f.length-m),t[a+1][0]=Tl,t[a+1][1]=d.substring(m),a++),a++}a++}}var N$=/[^a-zA-Z0-9]/,F$=/\s/,k$=/[\r\n]/,yTe=/\n\r?\n$/,ATe=/^\r?\n\r?\n/;function wTe(t){function e(m,g){if(!m||!g)return 6;var v=m.charAt(m.length-1),A=g.charAt(0),w=v.match(N$),x=A.match(N$),S=w&&v.match(F$),E=x&&A.match(F$),C=S&&v.match(k$),_=E&&A.match(k$),T=C&&m.match(yTe),O=_&&g.match(ATe);return T||O?5:C||_?4:w&&!S&&E?3:S||E?2:w||x?1:0}for(var n=1;n<t.length-1;){if(t[n-1][0]==Ss&&t[n+1][0]==Ss){var r=t[n-1][1],i=t[n][1],a=t[n+1][1],s=P5(r,i);if(s){var l=i.substring(i.length-s);r=r.substring(0,r.length-s),i=l+i.substring(0,i.length-s),a=l+a}for(var c=r,u=i,d=a,f=e(r,i)+e(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var h=e(r,i)+e(i,a);h>=f&&(f=h,c=r,u=i,d=a)}t[n-1][1]!=c&&(c?t[n-1][1]=c:(t.splice(n-1,1),n--),t[n][1]=u,d?t[n+1][1]=d:(t.splice(n+1,1),n--))}n++}}function FS(t,e){t.push([Ss,""]);for(var n=0,r=0,i=0,a="",s="",l;n<t.length;){if(n<t.length-1&&!t[n][1]){t.splice(n,1);continue}switch(t[n][0]){case Mo:i++,s+=t[n][1],n++;break;case Tl:r++,a+=t[n][1],n++;break;case Ss:var c=n-i-r-1;if(e){if(c>=0&&B$(t[c][1])){var u=t[c][1].slice(-1);if(t[c][1]=t[c][1].slice(0,-1),a=u+a,s=u+s,!t[c][1]){t.splice(c,1),n--;var d=c-1;t[d]&&t[d][0]===Mo&&(i++,s=t[d][1]+s,d--),t[d]&&t[d][0]===Tl&&(r++,a=t[d][1]+a,d--),c=d}}if(L$(t[n][1])){var u=t[n][1].charAt(0);t[n][1]=t[n][1].slice(1),a+=u,s+=u}}if(n<t.length-1&&!t[n][1]){t.splice(n,1);break}if(a.length>0||s.length>0){a.length>0&&s.length>0&&(l=NS(s,a),l!==0&&(c>=0?t[c][1]+=s.substring(0,l):(t.splice(0,0,[Ss,s.substring(0,l)]),n++),s=s.substring(l),a=a.substring(l)),l=P5(s,a),l!==0&&(t[n][1]=s.substring(s.length-l)+t[n][1],s=s.substring(0,s.length-l),a=a.substring(0,a.length-l)));var f=i+r;a.length===0&&s.length===0?(t.splice(n-f,f),n=n-f):a.length===0?(t.splice(n-f,f,[Mo,s]),n=n-f+1):s.length===0?(t.splice(n-f,f,[Tl,a]),n=n-f+1):(t.splice(n-f,f,[Tl,a],[Mo,s]),n=n-f+2)}n!==0&&t[n-1][0]===Ss?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,i=0,r=0,a="",s="";break}}t[t.length-1][1]===""&&t.pop();var h=!1;for(n=1;n<t.length-1;)t[n-1][0]===Ss&&t[n+1][0]===Ss&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)===t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),h=!0):t[n][1].substring(0,t[n+1][1].length)==t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),h=!0)),n++;h&&FS(t,e)}function P$(t){return t>=55296&&t<=56319}function M$(t){return t>=56320&&t<=57343}function L$(t){return M$(t.charCodeAt(0))}function B$(t){return P$(t.charCodeAt(t.length-1))}function STe(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}function kS(t,e,n,r){return B$(t)||L$(r)?null:STe([[Ss,t],[Tl,e],[Mo,n],[Ss,r]])}function xTe(t,e,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,i=typeof n=="number"?null:n.newRange,a=t.length,s=e.length;if(r.length===0&&(i===null||i.length===0)){var l=r.index,c=t.slice(0,l),u=t.slice(l),d=i?i.index:null;e:{var f=l+s-a;if(d!==null&&d!==f||f<0||f>s)break e;var h=e.slice(0,f),m=e.slice(f);if(m!==u)break e;var g=Math.min(l,f),v=c.slice(0,g),A=h.slice(0,g);if(v!==A)break e;var w=c.slice(g),x=h.slice(g);return kS(v,w,x,u)}e:{if(d!==null&&d!==l)break e;var S=l,h=e.slice(0,S),m=e.slice(S);if(h!==c)break e;var E=Math.min(a-S,s-S),C=u.slice(u.length-E),_=m.slice(m.length-E);if(C!==_)break e;var w=u.slice(0,u.length-E),x=m.slice(0,m.length-E);return kS(c,w,x,C)}}if(r.length>0&&i&&i.length===0)e:{var v=t.slice(0,r.index),C=t.slice(r.index+r.length),g=v.length,E=C.length;if(s<g+E)break e;var A=e.slice(0,g),_=e.slice(s-E);if(v!==A||C!==_)break e;var w=t.slice(g,a-E),x=e.slice(g,s-E);return kS(v,w,x,C)}return null}function M5(t,e,n,r){return kg(t,e,n,r,!0)}M5.INSERT=Mo,M5.DELETE=Tl,M5.EQUAL=Ss;var CTe=M5,L5={exports:{}};L5.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",d="[object Function]",f="[object GeneratorFunction]",h="[object Map]",m="[object Number]",g="[object Object]",v="[object Promise]",A="[object RegExp]",w="[object Set]",x="[object String]",S="[object Symbol]",E="[object WeakMap]",C="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",O="[object Float64Array]",F="[object Int8Array]",B="[object Int16Array]",M="[object Int32Array]",z="[object Uint8Array]",P="[object Uint8ClampedArray]",H="[object Uint16Array]",de="[object Uint32Array]",fe=/[\\^$.*+?()[\]{}|]/g,ne=/\w*$/,W=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,Y={};Y[a]=Y[s]=Y[C]=Y[_]=Y[l]=Y[c]=Y[T]=Y[O]=Y[F]=Y[B]=Y[M]=Y[h]=Y[m]=Y[g]=Y[A]=Y[w]=Y[x]=Y[S]=Y[z]=Y[P]=Y[H]=Y[de]=!0,Y[u]=Y[d]=Y[E]=!1;var pe=typeof Ni=="object"&&Ni&&Ni.Object===Object&&Ni,ie=typeof self=="object"&&self&&self.Object===Object&&self,J=pe||ie||Function("return this")(),Q=e&&!e.nodeType&&e,oe=Q&&!0&&t&&!t.nodeType&&t,ye=oe&&oe.exports===Q;function Te(ee,ke){return ee.set(ke[0],ke[1]),ee}function Ae(ee,ke){return ee.add(ke),ee}function be(ee,ke){for(var Ze=-1,Ut=ee?ee.length:0;++Ze<Ut&&ke(ee[Ze],Ze,ee)!==!1;);return ee}function we(ee,ke){for(var Ze=-1,Ut=ke.length,or=ee.length;++Ze<Ut;)ee[or+Ze]=ke[Ze];return ee}function re(ee,ke,Ze,Ut){var or=-1,Gn=ee?ee.length:0;for(Ut&&Gn&&(Ze=ee[++or]);++or<Gn;)Ze=ke(Ze,ee[or],or,ee);return Ze}function U(ee,ke){for(var Ze=-1,Ut=Array(ee);++Ze<ee;)Ut[Ze]=ke(Ze);return Ut}function Z(ee,ke){return ee==null?void 0:ee[ke]}function K(ee){var ke=!1;if(ee!=null&&typeof ee.toString!="function")try{ke=!!(ee+"")}catch{}return ke}function he(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut,or){Ze[++ke]=[or,Ut]}),Ze}function _e(ee,ke){return function(Ze){return ee(ke(Ze))}}function ge(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut){Ze[++ke]=Ut}),Ze}var ve=Array.prototype,Le=Function.prototype,Ne=Object.prototype,me=J["__core-js_shared__"],V=function(){var ee=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return ee?"Symbol(src)_1."+ee:""}(),te=Le.toString,X=Ne.hasOwnProperty,se=Ne.toString,ue=RegExp("^"+te.call(X).replace(fe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=ye?J.Buffer:void 0,De=J.Symbol,je=J.Uint8Array,ct=_e(Object.getPrototypeOf,Object),Dt=Object.create,nt=Ne.propertyIsEnumerable,xt=ve.splice,rt=Object.getOwnPropertySymbols,mt=Se?Se.isBuffer:void 0,Ot=_e(Object.keys,Object),$e=Zt(J,"DataView"),St=Zt(J,"Map"),Kt=Zt(J,"Promise"),An=Zt(J,"Set"),yn=Zt(J,"WeakMap"),vn=Zt(Object,"create"),On=Dn($e),Jn=Dn(St),Cn=Dn(Kt),jt=Dn(An),st=Dn(yn),et=De?De.prototype:void 0,dt=et?et.valueOf:void 0;function Ht(ee){var ke=-1,Ze=ee?ee.length:0;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Tn(){this.__data__=vn?vn(null):{}}function kn(ee){return this.has(ee)&&delete this.__data__[ee]}function Rn(ee){var ke=this.__data__;if(vn){var Ze=ke[ee];return Ze===r?void 0:Ze}return X.call(ke,ee)?ke[ee]:void 0}function cr(ee){var ke=this.__data__;return vn?ke[ee]!==void 0:X.call(ke,ee)}function Zn(ee,ke){var Ze=this.__data__;return Ze[ee]=vn&&ke===void 0?r:ke,this}Ht.prototype.clear=Tn,Ht.prototype.delete=kn,Ht.prototype.get=Rn,Ht.prototype.has=cr,Ht.prototype.set=Zn;function vr(ee){var ke=-1,Ze=ee?ee.length:0;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Ir(){this.__data__=[]}function dn(ee){var ke=this.__data__,Ze=Pe(ke,ee);if(Ze<0)return!1;var Ut=ke.length-1;return Ze==Ut?ke.pop():xt.call(ke,Ze,1),!0}function lt(ee){var ke=this.__data__,Ze=Pe(ke,ee);return Ze<0?void 0:ke[Ze][1]}function at(ee){return Pe(this.__data__,ee)>-1}function yt(ee,ke){var Ze=this.__data__,Ut=Pe(Ze,ee);return Ut<0?Ze.push([ee,ke]):Ze[Ut][1]=ke,this}vr.prototype.clear=Ir,vr.prototype.delete=dn,vr.prototype.get=lt,vr.prototype.has=at,vr.prototype.set=yt;function Vt(ee){var ke=-1,Ze=ee?ee.length:0;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Pt(){this.__data__={hash:new Ht,map:new(St||vr),string:new Ht}}function Ke(ee){return qi(this,ee).delete(ee)}function Oe(ee){return qi(this,ee).get(ee)}function Je(ee){return qi(this,ee).has(ee)}function ot(ee,ke){return qi(this,ee).set(ee,ke),this}Vt.prototype.clear=Pt,Vt.prototype.delete=Ke,Vt.prototype.get=Oe,Vt.prototype.has=Je,Vt.prototype.set=ot;function Lt(ee){this.__data__=new vr(ee)}function Gt(){this.__data__=new vr}function ft(ee){return this.__data__.delete(ee)}function Me(ee){return this.__data__.get(ee)}function Qe(ee){return this.__data__.has(ee)}function Ft(ee,ke){var Ze=this.__data__;if(Ze instanceof vr){var Ut=Ze.__data__;if(!St||Ut.length<n-1)return Ut.push([ee,ke]),this;Ze=this.__data__=new Vt(Ut)}return Ze.set(ee,ke),this}Lt.prototype.clear=Gt,Lt.prototype.delete=ft,Lt.prototype.get=Me,Lt.prototype.has=Qe,Lt.prototype.set=Ft;function zt(ee,ke){var Ze=Ua(ee)||ii(ee)?U(ee.length,String):[],Ut=Ze.length,or=!!Ut;for(var Gn in ee)(ke||X.call(ee,Gn))&&!(or&&(Gn=="length"||an(Gn,Ut)))&&Ze.push(Gn);return Ze}function At(ee,ke,Ze){var Ut=ee[ke];(!(X.call(ee,ke)&&Yr(Ut,Ze))||Ze===void 0&&!(ke in ee))&&(ee[ke]=Ze)}function Pe(ee,ke){for(var Ze=ee.length;Ze--;)if(Yr(ee[Ze][0],ke))return Ze;return-1}function Xe(ee,ke){return ee&&Ii(ke,po(ke),ee)}function Ct(ee,ke,Ze,Ut,or,Gn,_r){var Lr;if(Ut&&(Lr=Gn?Ut(ee,or,Gn,_r):Ut(ee)),Lr!==void 0)return Lr;if(!Ls(ee))return ee;var kr=Ua(ee);if(kr){if(Lr=Nn(ee),!ke)return ri(ee,Lr)}else{var Vr=Xt(ee),Zr=Vr==d||Vr==f;if(xs(ee))return Yn(ee,ke);if(Vr==g||Vr==a||Zr&&!Gn){if(K(ee))return Gn?ee:{};if(Lr=ar(Zr?{}:ee),!ke)return Da(ee,Xe(Lr,ee))}else{if(!Y[Vr])return Gn?ee:{};Lr=Jr(ee,Vr,Ct,ke)}}_r||(_r=new Lt);var Di=_r.get(ee);if(Di)return Di;if(_r.set(ee,Lr),!kr)var ji=Ze?_i(ee):po(ee);return be(ji||ee,function(Kr,Si){ji&&(Si=Kr,Kr=ee[Si]),At(Lr,Si,Ct(Kr,ke,Ze,Ut,Si,ee,_r))}),Lr}function qt(ee){return Ls(ee)?Dt(ee):{}}function Yt(ee,ke,Ze){var Ut=ke(ee);return Ua(ee)?Ut:we(Ut,Ze(ee))}function Pn(ee){return se.call(ee)}function Hn(ee){if(!Ls(ee)||Tt(ee))return!1;var ke=Cs(ee)||K(ee)?ue:W;return ke.test(Dn(ee))}function Tr(ee){if(!on(ee))return Ot(ee);var ke=[];for(var Ze in Object(ee))X.call(ee,Ze)&&Ze!="constructor"&&ke.push(Ze);return ke}function Yn(ee,ke){if(ke)return ee.slice();var Ze=new ee.constructor(ee.length);return ee.copy(Ze),Ze}function In(ee){var ke=new ee.constructor(ee.byteLength);return new je(ke).set(new je(ee)),ke}function Fr(ee,ke){var Ze=ke?In(ee.buffer):ee.buffer;return new ee.constructor(Ze,ee.byteOffset,ee.byteLength)}function Kn(ee,ke,Ze){var Ut=ke?Ze(he(ee),!0):he(ee);return re(Ut,Te,new ee.constructor)}function ur(ee){var ke=new ee.constructor(ee.source,ne.exec(ee));return ke.lastIndex=ee.lastIndex,ke}function Vn(ee,ke,Ze){var Ut=ke?Ze(ge(ee),!0):ge(ee);return re(Ut,Ae,new ee.constructor)}function gi(ee){return dt?Object(dt.call(ee)):{}}function li(ee,ke){var Ze=ke?In(ee.buffer):ee.buffer;return new ee.constructor(Ze,ee.byteOffset,ee.length)}function ri(ee,ke){var Ze=-1,Ut=ee.length;for(ke||(ke=Array(Ut));++Ze<Ut;)ke[Ze]=ee[Ze];return ke}function Ii(ee,ke,Ze,Ut){Ze||(Ze={});for(var or=-1,Gn=ke.length;++or<Gn;){var _r=ke[or],Lr=Ut?Ut(Ze[_r],ee[_r],_r,Ze,ee):void 0;At(Ze,_r,Lr===void 0?ee[_r]:Lr)}return Ze}function Da(ee,ke){return Ii(ee,Ue(ee),ke)}function _i(ee){return Yt(ee,po,Ue)}function qi(ee,ke){var Ze=ee.__data__;return Ye(ke)?Ze[typeof ke=="string"?"string":"hash"]:Ze.map}function Zt(ee,ke){var Ze=Z(ee,ke);return Hn(Ze)?Ze:void 0}var Ue=rt?_e(rt,Object):yi,Xt=Pn;($e&&Xt(new $e(new ArrayBuffer(1)))!=_||St&&Xt(new St)!=h||Kt&&Xt(Kt.resolve())!=v||An&&Xt(new An)!=w||yn&&Xt(new yn)!=E)&&(Xt=function(ee){var ke=se.call(ee),Ze=ke==g?ee.constructor:void 0,Ut=Ze?Dn(Ze):void 0;if(Ut)switch(Ut){case On:return _;case Jn:return h;case Cn:return v;case jt:return w;case st:return E}return ke});function Nn(ee){var ke=ee.length,Ze=ee.constructor(ke);return ke&&typeof ee[0]=="string"&&X.call(ee,"index")&&(Ze.index=ee.index,Ze.input=ee.input),Ze}function ar(ee){return typeof ee.constructor=="function"&&!on(ee)?qt(ct(ee)):{}}function Jr(ee,ke,Ze,Ut){var or=ee.constructor;switch(ke){case C:return In(ee);case l:case c:return new or(+ee);case _:return Fr(ee,Ut);case T:case O:case F:case B:case M:case z:case P:case H:case de:return li(ee,Ut);case h:return Kn(ee,Ut,Ze);case m:case x:return new or(ee);case A:return ur(ee);case w:return Vn(ee,Ut,Ze);case S:return gi(ee)}}function an(ee,ke){return ke=ke??i,!!ke&&(typeof ee=="number"||ae.test(ee))&&ee>-1&&ee%1==0&&ee<ke}function Ye(ee){var ke=typeof ee;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?ee!=="__proto__":ee===null}function Tt(ee){return!!V&&V in ee}function on(ee){var ke=ee&&ee.constructor,Ze=typeof ke=="function"&&ke.prototype||Ne;return ee===Ze}function Dn(ee){if(ee!=null){try{return te.call(ee)}catch{}try{return ee+""}catch{}}return""}function br(ee){return Ct(ee,!0,!0)}function Yr(ee,ke){return ee===ke||ee!==ee&&ke!==ke}function ii(ee){return Il(ee)&&X.call(ee,"callee")&&(!nt.call(ee,"callee")||se.call(ee)==a)}var Ua=Array.isArray;function fs(ee){return ee!=null&&Ms(ee.length)&&!Cs(ee)}function Il(ee){return _l(ee)&&fs(ee)}var xs=mt||Ai;function Cs(ee){var ke=Ls(ee)?se.call(ee):"";return ke==d||ke==f}function Ms(ee){return typeof ee=="number"&&ee>-1&&ee%1==0&&ee<=i}function Ls(ee){var ke=typeof ee;return!!ee&&(ke=="object"||ke=="function")}function _l(ee){return!!ee&&typeof ee=="object"}function po(ee){return fs(ee)?zt(ee):Tr(ee)}function yi(){return[]}function Ai(){return!1}t.exports=br}(L5,L5.exports);var V$=L5.exports,B5={exports:{}};B5.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",A="[object Number]",w="[object Null]",x="[object Object]",S="[object Promise]",E="[object Proxy]",C="[object RegExp]",_="[object Set]",T="[object String]",O="[object Symbol]",F="[object Undefined]",B="[object WeakMap]",M="[object ArrayBuffer]",z="[object DataView]",P="[object Float32Array]",H="[object Float64Array]",de="[object Int8Array]",fe="[object Int16Array]",ne="[object Int32Array]",W="[object Uint8Array]",ae="[object Uint8ClampedArray]",Y="[object Uint16Array]",pe="[object Uint32Array]",ie=/[\\^$.*+?()[\]{}|]/g,J=/^\[object .+?Constructor\]$/,Q=/^(?:0|[1-9]\d*)$/,oe={};oe[P]=oe[H]=oe[de]=oe[fe]=oe[ne]=oe[W]=oe[ae]=oe[Y]=oe[pe]=!0,oe[l]=oe[c]=oe[M]=oe[d]=oe[z]=oe[f]=oe[h]=oe[m]=oe[v]=oe[A]=oe[x]=oe[C]=oe[_]=oe[T]=oe[B]=!1;var ye=typeof Ni=="object"&&Ni&&Ni.Object===Object&&Ni,Te=typeof self=="object"&&self&&self.Object===Object&&self,Ae=ye||Te||Function("return this")(),be=e&&!e.nodeType&&e,we=be&&!0&&t&&!t.nodeType&&t,re=we&&we.exports===be,U=re&&ye.process,Z=function(){try{return U&&U.binding&&U.binding("util")}catch{}}(),K=Z&&Z.isTypedArray;function he(ee,ke){for(var Ze=-1,Ut=ee==null?0:ee.length,or=0,Gn=[];++Ze<Ut;){var _r=ee[Ze];ke(_r,Ze,ee)&&(Gn[or++]=_r)}return Gn}function _e(ee,ke){for(var Ze=-1,Ut=ke.length,or=ee.length;++Ze<Ut;)ee[or+Ze]=ke[Ze];return ee}function ge(ee,ke){for(var Ze=-1,Ut=ee==null?0:ee.length;++Ze<Ut;)if(ke(ee[Ze],Ze,ee))return!0;return!1}function ve(ee,ke){for(var Ze=-1,Ut=Array(ee);++Ze<ee;)Ut[Ze]=ke(Ze);return Ut}function Le(ee){return function(ke){return ee(ke)}}function Ne(ee,ke){return ee.has(ke)}function me(ee,ke){return ee==null?void 0:ee[ke]}function V(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut,or){Ze[++ke]=[or,Ut]}),Ze}function te(ee,ke){return function(Ze){return ee(ke(Ze))}}function X(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut){Ze[++ke]=Ut}),Ze}var se=Array.prototype,ue=Function.prototype,Se=Object.prototype,De=Ae["__core-js_shared__"],je=ue.toString,ct=Se.hasOwnProperty,Dt=function(){var ee=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return ee?"Symbol(src)_1."+ee:""}(),nt=Se.toString,xt=RegExp("^"+je.call(ct).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=re?Ae.Buffer:void 0,mt=Ae.Symbol,Ot=Ae.Uint8Array,$e=Se.propertyIsEnumerable,St=se.splice,Kt=mt?mt.toStringTag:void 0,An=Object.getOwnPropertySymbols,yn=rt?rt.isBuffer:void 0,vn=te(Object.keys,Object),On=Ue(Ae,"DataView"),Jn=Ue(Ae,"Map"),Cn=Ue(Ae,"Promise"),jt=Ue(Ae,"Set"),st=Ue(Ae,"WeakMap"),et=Ue(Object,"create"),dt=Dn(On),Ht=Dn(Jn),Tn=Dn(Cn),kn=Dn(jt),Rn=Dn(st),cr=mt?mt.prototype:void 0,Zn=cr?cr.valueOf:void 0;function vr(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Ir(){this.__data__=et?et(null):{},this.size=0}function dn(ee){var ke=this.has(ee)&&delete this.__data__[ee];return this.size-=ke?1:0,ke}function lt(ee){var ke=this.__data__;if(et){var Ze=ke[ee];return Ze===r?void 0:Ze}return ct.call(ke,ee)?ke[ee]:void 0}function at(ee){var ke=this.__data__;return et?ke[ee]!==void 0:ct.call(ke,ee)}function yt(ee,ke){var Ze=this.__data__;return this.size+=this.has(ee)?0:1,Ze[ee]=et&&ke===void 0?r:ke,this}vr.prototype.clear=Ir,vr.prototype.delete=dn,vr.prototype.get=lt,vr.prototype.has=at,vr.prototype.set=yt;function Vt(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Pt(){this.__data__=[],this.size=0}function Ke(ee){var ke=this.__data__,Ze=Yn(ke,ee);if(Ze<0)return!1;var Ut=ke.length-1;return Ze==Ut?ke.pop():St.call(ke,Ze,1),--this.size,!0}function Oe(ee){var ke=this.__data__,Ze=Yn(ke,ee);return Ze<0?void 0:ke[Ze][1]}function Je(ee){return Yn(this.__data__,ee)>-1}function ot(ee,ke){var Ze=this.__data__,Ut=Yn(Ze,ee);return Ut<0?(++this.size,Ze.push([ee,ke])):Ze[Ut][1]=ke,this}Vt.prototype.clear=Pt,Vt.prototype.delete=Ke,Vt.prototype.get=Oe,Vt.prototype.has=Je,Vt.prototype.set=ot;function Lt(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Gt(){this.size=0,this.__data__={hash:new vr,map:new(Jn||Vt),string:new vr}}function ft(ee){var ke=Zt(this,ee).delete(ee);return this.size-=ke?1:0,ke}function Me(ee){return Zt(this,ee).get(ee)}function Qe(ee){return Zt(this,ee).has(ee)}function Ft(ee,ke){var Ze=Zt(this,ee),Ut=Ze.size;return Ze.set(ee,ke),this.size+=Ze.size==Ut?0:1,this}Lt.prototype.clear=Gt,Lt.prototype.delete=ft,Lt.prototype.get=Me,Lt.prototype.has=Qe,Lt.prototype.set=Ft;function zt(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.__data__=new Lt;++ke<Ze;)this.add(ee[ke])}function At(ee){return this.__data__.set(ee,r),this}function Pe(ee){return this.__data__.has(ee)}zt.prototype.add=zt.prototype.push=At,zt.prototype.has=Pe;function Xe(ee){var ke=this.__data__=new Vt(ee);this.size=ke.size}function Ct(){this.__data__=new Vt,this.size=0}function qt(ee){var ke=this.__data__,Ze=ke.delete(ee);return this.size=ke.size,Ze}function Yt(ee){return this.__data__.get(ee)}function Pn(ee){return this.__data__.has(ee)}function Hn(ee,ke){var Ze=this.__data__;if(Ze instanceof Vt){var Ut=Ze.__data__;if(!Jn||Ut.length<n-1)return Ut.push([ee,ke]),this.size=++Ze.size,this;Ze=this.__data__=new Lt(Ut)}return Ze.set(ee,ke),this.size=Ze.size,this}Xe.prototype.clear=Ct,Xe.prototype.delete=qt,Xe.prototype.get=Yt,Xe.prototype.has=Pn,Xe.prototype.set=Hn;function Tr(ee,ke){var Ze=ii(ee),Ut=!Ze&&Yr(ee),or=!Ze&&!Ut&&fs(ee),Gn=!Ze&&!Ut&&!or&&_l(ee),_r=Ze||Ut||or||Gn,Lr=_r?ve(ee.length,String):[],kr=Lr.length;for(var Vr in ee)(ke||ct.call(ee,Vr))&&!(_r&&(Vr=="length"||or&&(Vr=="offset"||Vr=="parent")||Gn&&(Vr=="buffer"||Vr=="byteLength"||Vr=="byteOffset")||Jr(Vr,kr)))&&Lr.push(Vr);return Lr}function Yn(ee,ke){for(var Ze=ee.length;Ze--;)if(br(ee[Ze][0],ke))return Ze;return-1}function In(ee,ke,Ze){var Ut=ke(ee);return ii(ee)?Ut:_e(Ut,Ze(ee))}function Fr(ee){return ee==null?ee===void 0?F:w:Kt&&Kt in Object(ee)?Xt(ee):on(ee)}function Kn(ee){return Ls(ee)&&Fr(ee)==l}function ur(ee,ke,Ze,Ut,or){return ee===ke?!0:ee==null||ke==null||!Ls(ee)&&!Ls(ke)?ee!==ee&&ke!==ke:Vn(ee,ke,Ze,Ut,ur,or)}function Vn(ee,ke,Ze,Ut,or,Gn){var _r=ii(ee),Lr=ii(ke),kr=_r?c:ar(ee),Vr=Lr?c:ar(ke);kr=kr==l?x:kr,Vr=Vr==l?x:Vr;var Zr=kr==x,Di=Vr==x,ji=kr==Vr;if(ji&&fs(ee)){if(!fs(ke))return!1;_r=!0,Zr=!1}if(ji&&!Zr)return Gn||(Gn=new Xe),_r||_l(ee)?Ii(ee,ke,Ze,Ut,or,Gn):Da(ee,ke,kr,Ze,Ut,or,Gn);if(!(Ze&i)){var Kr=Zr&&ct.call(ee,"__wrapped__"),Si=Di&&ct.call(ke,"__wrapped__");if(Kr||Si){var ya=Kr?ee.value():ee,La=Si?ke.value():ke;return Gn||(Gn=new Xe),or(ya,La,Ze,Ut,Gn)}}return ji?(Gn||(Gn=new Xe),_i(ee,ke,Ze,Ut,or,Gn)):!1}function gi(ee){if(!Ms(ee)||Ye(ee))return!1;var ke=xs(ee)?xt:J;return ke.test(Dn(ee))}function li(ee){return Ls(ee)&&Cs(ee.length)&&!!oe[Fr(ee)]}function ri(ee){if(!Tt(ee))return vn(ee);var ke=[];for(var Ze in Object(ee))ct.call(ee,Ze)&&Ze!="constructor"&&ke.push(Ze);return ke}function Ii(ee,ke,Ze,Ut,or,Gn){var _r=Ze&i,Lr=ee.length,kr=ke.length;if(Lr!=kr&&!(_r&&kr>Lr))return!1;var Vr=Gn.get(ee);if(Vr&&Gn.get(ke))return Vr==ke;var Zr=-1,Di=!0,ji=Ze&a?new zt:void 0;for(Gn.set(ee,ke),Gn.set(ke,ee);++Zr<Lr;){var Kr=ee[Zr],Si=ke[Zr];if(Ut)var ya=_r?Ut(Si,Kr,Zr,ke,ee,Gn):Ut(Kr,Si,Zr,ee,ke,Gn);if(ya!==void 0){if(ya)continue;Di=!1;break}if(ji){if(!ge(ke,function(La,hs){if(!Ne(ji,hs)&&(Kr===La||or(Kr,La,Ze,Ut,Gn)))return ji.push(hs)})){Di=!1;break}}else if(!(Kr===Si||or(Kr,Si,Ze,Ut,Gn))){Di=!1;break}}return Gn.delete(ee),Gn.delete(ke),Di}function Da(ee,ke,Ze,Ut,or,Gn,_r){switch(Ze){case z:if(ee.byteLength!=ke.byteLength||ee.byteOffset!=ke.byteOffset)return!1;ee=ee.buffer,ke=ke.buffer;case M:return!(ee.byteLength!=ke.byteLength||!Gn(new Ot(ee),new Ot(ke)));case d:case f:case A:return br(+ee,+ke);case h:return ee.name==ke.name&&ee.message==ke.message;case C:case T:return ee==ke+"";case v:var Lr=V;case _:var kr=Ut&i;if(Lr||(Lr=X),ee.size!=ke.size&&!kr)return!1;var Vr=_r.get(ee);if(Vr)return Vr==ke;Ut|=a,_r.set(ee,ke);var Zr=Ii(Lr(ee),Lr(ke),Ut,or,Gn,_r);return _r.delete(ee),Zr;case O:if(Zn)return Zn.call(ee)==Zn.call(ke)}return!1}function _i(ee,ke,Ze,Ut,or,Gn){var _r=Ze&i,Lr=qi(ee),kr=Lr.length,Vr=qi(ke),Zr=Vr.length;if(kr!=Zr&&!_r)return!1;for(var Di=kr;Di--;){var ji=Lr[Di];if(!(_r?ji in ke:ct.call(ke,ji)))return!1}var Kr=Gn.get(ee);if(Kr&&Gn.get(ke))return Kr==ke;var Si=!0;Gn.set(ee,ke),Gn.set(ke,ee);for(var ya=_r;++Di<kr;){ji=Lr[Di];var La=ee[ji],hs=ke[ji];if(Ut)var ps=_r?Ut(hs,La,ji,ke,ee,Gn):Ut(La,hs,ji,ee,ke,Gn);if(!(ps===void 0?La===hs||or(La,hs,Ze,Ut,Gn):ps)){Si=!1;break}ya||(ya=ji=="constructor")}if(Si&&!ya){var qa=ee.constructor,ci=ke.constructor;qa!=ci&&"constructor"in ee&&"constructor"in ke&&!(typeof qa=="function"&&qa instanceof qa&&typeof ci=="function"&&ci instanceof ci)&&(Si=!1)}return Gn.delete(ee),Gn.delete(ke),Si}function qi(ee){return In(ee,po,Nn)}function Zt(ee,ke){var Ze=ee.__data__;return an(ke)?Ze[typeof ke=="string"?"string":"hash"]:Ze.map}function Ue(ee,ke){var Ze=me(ee,ke);return gi(Ze)?Ze:void 0}function Xt(ee){var ke=ct.call(ee,Kt),Ze=ee[Kt];try{ee[Kt]=void 0;var Ut=!0}catch{}var or=nt.call(ee);return Ut&&(ke?ee[Kt]=Ze:delete ee[Kt]),or}var Nn=An?function(ee){return ee==null?[]:(ee=Object(ee),he(An(ee),function(ke){return $e.call(ee,ke)}))}:yi,ar=Fr;(On&&ar(new On(new ArrayBuffer(1)))!=z||Jn&&ar(new Jn)!=v||Cn&&ar(Cn.resolve())!=S||jt&&ar(new jt)!=_||st&&ar(new st)!=B)&&(ar=function(ee){var ke=Fr(ee),Ze=ke==x?ee.constructor:void 0,Ut=Ze?Dn(Ze):"";if(Ut)switch(Ut){case dt:return z;case Ht:return v;case Tn:return S;case kn:return _;case Rn:return B}return ke});function Jr(ee,ke){return ke=ke??s,!!ke&&(typeof ee=="number"||Q.test(ee))&&ee>-1&&ee%1==0&&ee<ke}function an(ee){var ke=typeof ee;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?ee!=="__proto__":ee===null}function Ye(ee){return!!Dt&&Dt in ee}function Tt(ee){var ke=ee&&ee.constructor,Ze=typeof ke=="function"&&ke.prototype||Se;return ee===Ze}function on(ee){return nt.call(ee)}function Dn(ee){if(ee!=null){try{return je.call(ee)}catch{}try{return ee+""}catch{}}return""}function br(ee,ke){return ee===ke||ee!==ee&&ke!==ke}var Yr=Kn(function(){return arguments}())?Kn:function(ee){return Ls(ee)&&ct.call(ee,"callee")&&!$e.call(ee,"callee")},ii=Array.isArray;function Ua(ee){return ee!=null&&Cs(ee.length)&&!xs(ee)}var fs=yn||Ai;function Il(ee,ke){return ur(ee,ke)}function xs(ee){if(!Ms(ee))return!1;var ke=Fr(ee);return ke==m||ke==g||ke==u||ke==E}function Cs(ee){return typeof ee=="number"&&ee>-1&&ee%1==0&&ee<=s}function Ms(ee){var ke=typeof ee;return ee!=null&&(ke=="object"||ke=="function")}function Ls(ee){return ee!=null&&typeof ee=="object"}var _l=K?Le(K):li;function po(ee){return Ua(ee)?Tr(ee):ri(ee)}function yi(){return[]}function Ai(){return!1}t.exports=Il}(B5,B5.exports);var U$=B5.exports,PS={};Object.defineProperty(PS,"__esModule",{value:!0});const TTe=V$,ETe=U$;var MS;(function(t){function e(a={},s={},l=!1){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let c=TTe(s);l||(c=Object.keys(c).reduce((u,d)=>(c[d]!=null&&(u[d]=c[d]),u),{}));for(const u in a)a[u]!==void 0&&s[u]===void 0&&(c[u]=a[u]);return Object.keys(c).length>0?c:void 0}t.compose=e;function n(a={},s={}){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});const l=Object.keys(a).concat(Object.keys(s)).reduce((c,u)=>(ETe(a[u],s[u])||(c[u]=s[u]===void 0?null:s[u]),c),{});return Object.keys(l).length>0?l:void 0}t.diff=n;function r(a={},s={}){a=a||{};const l=Object.keys(s).reduce((c,u)=>(s[u]!==a[u]&&a[u]!==void 0&&(c[u]=s[u]),c),{});return Object.keys(a).reduce((c,u)=>(a[u]!==s[u]&&s[u]===void 0&&(c[u]=null),c),l)}t.invert=r;function i(a,s,l=!1){if(typeof a!="object")return s;if(typeof s!="object")return;if(!l)return s;const c=Object.keys(s).reduce((u,d)=>(a[d]===void 0&&(u[d]=s[d]),u),{});return Object.keys(c).length>0?c:void 0}t.transform=i})(MS||(MS={})),PS.default=MS;var V5={};Object.defineProperty(V5,"__esModule",{value:!0});var LS;(function(t){function e(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}t.length=e})(LS||(LS={})),V5.default=LS;var BS={};Object.defineProperty(BS,"__esModule",{value:!0});const q$=V5;class ITe{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const n=this.ops[this.index];if(n){const r=this.offset,i=q$.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete=="number")return{delete:e};{const a={};return n.attributes&&(a.attributes=n.attributes),typeof n.retain=="number"?a.retain=e:typeof n.retain=="object"&&n.retain!==null?a.retain=n.retain:typeof n.insert=="string"?a.insert=n.insert.substr(r,e):a.insert=n.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?q$.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const e=this.offset,n=this.index,r=this.next(),i=this.ops.slice(this.index);return this.offset=e,this.index=n,[r].concat(i)}}else return[]}}BS.default=ITe,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=CTe,r=V$,i=U$,a=PS;e.AttributeMap=a.default;const s=V5;e.Op=s.default;const l=BS;e.OpIterator=l.default;const c="\0",u=(f,h)=>{if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const m=Object.keys(f)[0];if(!m||m!==Object.keys(h)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(h)[0]}`);return[m,f[m],h[m]]};class d{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,m){this.handlers[h]=m}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const m=this.handlers[h];if(!m)throw new Error(`no handlers for embed type "${h}"`);return m}insert(h,m){const g={};return typeof h=="string"&&h.length===0?this:(g.insert=h,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(g.attributes=m),this.push(g))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,m){if(typeof h=="number"&&h<=0)return this;const g={retain:h};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(g.attributes=m),this.push(g)}push(h){let m=this.ops.length,g=this.ops[m-1];if(h=r(h),typeof g=="object"){if(typeof h.delete=="number"&&typeof g.delete=="number")return this.ops[m-1]={delete:g.delete+h.delete},this;if(typeof g.delete=="number"&&h.insert!=null&&(m-=1,g=this.ops[m-1],typeof g!="object"))return this.ops.unshift(h),this;if(i(h.attributes,g.attributes)){if(typeof h.insert=="string"&&typeof g.insert=="string")return this.ops[m-1]={insert:g.insert+h.insert},typeof h.attributes=="object"&&(this.ops[m-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof g.retain=="number")return this.ops[m-1]={retain:g.retain+h.retain},typeof h.attributes=="object"&&(this.ops[m-1].attributes=h.attributes),this}}return m===this.ops.length?this.ops.push(h):this.ops.splice(m,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const m=[],g=[];return this.forEach(v=>{(h(v)?m:g).push(v)}),[m,g]}reduce(h,m){return this.ops.reduce(h,m)}changeLength(){return this.reduce((h,m)=>m.insert?h+s.default.length(m):m.delete?h-m.delete:h,0)}length(){return this.reduce((h,m)=>h+s.default.length(m),0)}slice(h=0,m=1/0){const g=[],v=new l.default(this.ops);let A=0;for(;A<m&&v.hasNext();){let w;A<h?w=v.next(h-A):(w=v.next(m-A),g.push(w)),A+=s.default.length(w)}return new d(g)}compose(h){const m=new l.default(this.ops),g=new l.default(h.ops),v=[],A=g.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let x=A.retain;for(;m.peekType()==="insert"&&m.peekLength()<=x;)x-=m.peekLength(),v.push(m.next());A.retain-x>0&&g.next(A.retain-x)}const w=new d(v);for(;m.hasNext()||g.hasNext();)if(g.peekType()==="insert")w.push(g.next());else if(m.peekType()==="delete")w.push(m.next());else{const x=Math.min(m.peekLength(),g.peekLength()),S=m.next(x),E=g.next(x);if(E.retain){const C={};if(typeof S.retain=="number")C.retain=typeof E.retain=="number"?x:E.retain;else if(typeof E.retain=="number")S.retain==null?C.insert=S.insert:C.retain=S.retain;else{const T=S.retain==null?"insert":"retain",[O,F,B]=u(S[T],E.retain),M=d.getHandler(O);C[T]={[O]:M.compose(F,B,T==="retain")}}const _=a.default.compose(S.attributes,E.attributes,typeof S.retain=="number");if(_&&(C.attributes=_),w.push(C),!g.hasNext()&&i(w.ops[w.ops.length-1],C)){const T=new d(m.rest());return w.concat(T).chop()}}else typeof E.delete=="number"&&(typeof S.retain=="number"||typeof S.retain=="object"&&S.retain!==null)&&w.push(E)}return w.chop()}concat(h){const m=new d(this.ops.slice());return h.ops.length>0&&(m.push(h.ops[0]),m.ops=m.ops.concat(h.ops.slice(1))),m}diff(h,m){if(this.ops===h.ops)return new d;const g=[this,h].map(S=>S.map(E=>{if(E.insert!=null)return typeof E.insert=="string"?E.insert:c;const C=S===h?"on":"with";throw new Error("diff() called "+C+" non-document")}).join("")),v=new d,A=n(g[0],g[1],m,!0),w=new l.default(this.ops),x=new l.default(h.ops);return A.forEach(S=>{let E=S[1].length;for(;E>0;){let C=0;switch(S[0]){case n.INSERT:C=Math.min(x.peekLength(),E),v.push(x.next(C));break;case n.DELETE:C=Math.min(E,w.peekLength()),w.next(C),v.delete(C);break;case n.EQUAL:C=Math.min(w.peekLength(),x.peekLength(),E);const _=w.next(C),T=x.next(C);i(_.insert,T.insert)?v.retain(C,a.default.diff(_.attributes,T.attributes)):v.push(T).delete(C);break}E-=C}}),v.chop()}eachLine(h,m=`
|
|
4174
|
+
*/const Hxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Hxe.displayName="DataRouter");const zxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(zxe.displayName="DataRouterState");const Yxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Yxe.displayName="Await");const Kxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Kxe.displayName="Navigation");const Xxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Xxe.displayName="Location");const c$=y.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(c$.displayName="Route");const Rxe=y.createContext(null);process.env.NODE_ENV!=="production"&&(Rxe.displayName="RouteError");function u$(){let{matches:t}=y.useContext(c$),e=t[t.length-1];return e?e.params:{}}new Promise(()=>{});const Gxe=t=>{var r;const{section:e}=t,{userSelectedLanguage:n}=ln();return o.jsxs("div",{children:[" ",(r=e==null?void 0:e.heading)==null?void 0:r[n==null?void 0:n.type]," : "," ",o.jsx(Na,{placeholder:"enter weight",max:100,min:0}),o.jsx("br",{}),o.jsx("br",{})]})},Wxe=()=>{const[t]=N.useState([]);return N.useEffect(()=>()=>{},[]),o.jsx("div",{className:"card",children:(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((e,n)=>o.jsxs("div",{children:[o.jsx("ul",{className:"list-none p-0 m-0",children:o.jsxs("li",{className:"flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-3",style:{borderRadius:"10px"},children:[o.jsx("div",{children:o.jsxs("div",{children:[o.jsx("span",{className:"inline-flex justify-content-center align-items-center w-2rem h-2rem border-circle border-1",children:(e==null?void 0:e.is_active)===1?o.jsx("i",{style:{color:"green"},className:"pi pi-check"}):o.jsx("i",{className:"pi pi-check"})}),o.jsxs("span",{className:" font-bold ml-2",children:[e==null?void 0:e.version_name,(e==null?void 0:e.is_active)===1?" - Active ":""]})]})}),o.jsx("div",{className:"flex align-items-center justify-content-between md:justify-content-end mt-3 md:mt-0",children:o.jsx("div",{className:"text-right ml-3",children:o.jsx("span",{className:" font-bold",children:(e==null?void 0:e.is_active)===1?"":o.jsx(kt,{text:!0,onClick:()=>{setTimeout(()=>{},3e3)},severity:"success",label:"Make this version active",icon:"pi pi-check",size:"small"})})})})]})}),o.jsx("hr",{})]},`version-item-${n}`)))})},Qxe=()=>{const{setLayout:t,formBuilderConfigurationType:e}=ln(),n=N.useRef(null),r=s=>{var l;switch((l=s==null?void 0:s.formType)==null?void 0:l.key){case(e==null?void 0:e.key):t(s==null?void 0:s.layout);break}},i=async s=>{const l=s.target.files;if(l&&l.length>0){const c=await a(l[0]);r(c)}};async function a(s){return new Promise((l,c)=>{const u=new FileReader;u.onload=d=>{var f;return l(JSON.parse((f=d.target)==null?void 0:f.result))},u.onerror=d=>c(d),u.readAsText(s)})}return o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:n,type:"file",style:{display:"none"},id:"schema",name:"schema",onChange:i}),o.jsx(kt,{text:!0,size:"small",className:"p-button-primary ml-3 mr-3",onClick:()=>{var s;(s=n.current)==null||s.click()},label:"Import Template"})]})},Jxe=()=>{const{builderTemplateName:t,formBuilderFormSchema:e}=ln(),n=function(){const r=document.createElement("a");return function(i,a){const s=JSON.stringify(i),l=new Blob([s],{type:"octet/stream"}),c=window.URL.createObjectURL(l);r.href=c,r.download=a,r.click(),window.URL.revokeObjectURL(c)}}();return o.jsx(kt,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>{const r=e,i=t+".json";n(r,i)},label:"Export Template"})};function Og(){return Og=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Og.apply(this,arguments)}function Ng(t){"@babel/helpers - typeof";return Ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ng(t)}function Zxe(t,e){if(Ng(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ng(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eCe(t){var e=Zxe(t,"string");return Ng(e)==="symbol"?e:String(e)}function tCe(t,e,n){return e=eCe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nCe={root:function(e){var n=e.props,r=e.checked;return pt("p-inputswitch p-component",{"p-highlight":r,"p-disabled":n.disabled,"p-invalid":n.invalid})},input:"p-inputswitch-input",slider:"p-inputswitch-slider"},_5=Bn.extend({defaultProps:{__TYPE:"InputSwitch",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onBlur:null,onChange:null,onFocus:null,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,children:void 0},css:{classes:nCe}});function d$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rCe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?d$(Object(n),!0).forEach(function(r){tCe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ks=y.memo(y.forwardRef(function(t,e){var n=jn(),r=y.useContext(nr),i=_5.getProps(t,r),a=_5.setMetaData({props:i}),s=a.ptm,l=a.cx,c=a.isUnstyled;fi(_5.css.styles,c,{name:"inputswitch"});var u=y.useRef(null),d=y.useRef(i.inputRef),f=i.checked===i.trueValue,h=function(_){if(i.onChange){var T=f?i.falseValue:i.trueValue;i.onChange({originalEvent:_,value:T,stopPropagation:function(){_==null||_.stopPropagation()},preventDefault:function(){_==null||_.preventDefault()},target:{name:i.name,id:i.id,value:T}})}},m=function(_){var T;i==null||(T=i.onFocus)===null||T===void 0||T.call(i,_)},g=function(_){var T;i==null||(T=i.onBlur)===null||T===void 0||T.call(i,_)};y.useImperativeHandle(e,function(){return{props:i,focus:function(){return Ee.focus(d.current)},getElement:function(){return u.current},getInput:function(){return d.current}}}),y.useEffect(function(){Fe.combinedRefs(d,i.inputRef)},[d,i.inputRef]),Mi(function(){i.autoFocus&&Ee.focus(d.current,i.autoFocus)});var v=Fe.isNotEmpty(i.tooltip),A=_5.getOtherProps(i),w=Fe.reduceKeys(A,Ee.ARIA_PROPS),x=n({className:pt(i.className,l("root",{checked:f})),style:i.style,role:"checkbox","aria-checked":f,"data-p-highlight":f,"data-p-disabled":i.disabled},A,s("root")),S=n(rCe({type:"checkbox",id:i.inputId,name:i.name,checked:f,onChange:h,onFocus:m,onBlur:g,disabled:i.disabled,role:"switch",tabIndex:i.tabIndex,"aria-checked":f,className:l("input")},w),s("input")),E=n({className:l("slider")},s("slider"));return y.createElement(y.Fragment,null,y.createElement("div",Og({id:i.id,ref:u},x),y.createElement("input",Og({ref:d},S)),y.createElement("span",E)),v&&y.createElement(rn,Og({target:u,content:i.tooltip,pt:s("tooltip")},i.tooltipOptions)))}));Ks.displayName="InputSwitch";const iCe=()=>{var x,S,E,C,_;const{formBuilderFormSchema:t,selectFormBuilderLanguage:e,formBuilderSchemaLanguages:n,unselectFormBuilderLanguage:r,schemaBuilderUpdate:i,builderTemplateName:a,formBuilderLoading:s,formBuilderConfigurationType:l,saveFormTemplateNewVersion:c}=ln(),[u,d]=N.useState(),f=u$(),h=f==null?void 0:f.form_template_id,m=cb({initialValues:{firstName:"",lastName:"",contact:"",email:""},validate:()=>{const T={};return m.values.application_url="",T},onSubmit:()=>{}}),g=l==null?void 0:l.key,v=(T,O)=>{T!=null&&T.value?e(O):r(O),d(!u)},A=T=>{for(const[,O]of t.layout.entries())for(const[,F]of O.children.entries())for(const[,B]of F.children.entries())for(const[,M]of B.children.entries())for(const[,z]of M.children.entries())z.isFluid=T.value},w=()=>{MD({message:"Are you sure you want to a new version for this form?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{c(h,t)},reject:()=>{}})};return o.jsx(o.Fragment,{children:o.jsx("form",{onSubmit:m.handleSubmit,className:"p-fluid",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{height:"15rem"})}):o.jsxs(hi,{header:"General",children:[o.jsxs("h5",{children:["Form Title : ",a||""," "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"binary",onChange:T=>{i({showIntroTab:T.value})},checked:t==null?void 0:t.showIntroTab}),o.jsx("label",{htmlFor:"binary",children:"Show Intro Page"})," "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({enableAutoSave:T.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Task Render Form User Data"})]}),g===N7&&o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({surveyQuestionSlide:T.value})},checked:t==null?void 0:t.surveyQuestionSlide}),o.jsx("label",{htmlFor:"auto-save",children:"Survey Slide Per Question"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"showConditionalFields",onChange:T=>{i({showConditionalFields:T.value})},checked:t==null?void 0:t.showConditionalFields,disabled:t==null?void 0:t.surveyQuestionSlide}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Show Conditional Fields ",(t==null?void 0:t.surveyQuestionSlide)===!0&&o.jsx("small",{className:"error",children:"Cant use Survey Slide Per Question with Conditional Fields"})]})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"enableReviewTask",onChange:T=>{i({enableReviewTask:T.value})},checked:t==null?void 0:t.enableReviewTask}),o.jsx("label",{htmlFor:"enableReviewTask",children:"Enable Admin Review Task"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"enableFormFluid",onChange:T=>{i({enableFormFluid:T.value}),A(T)},checked:t==null?void 0:t.enableFormFluid}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Form Fluid"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"enableFieldEnumeration",onChange:T=>{i({enableFieldEnumeration:T.value}),A(T)},checked:t==null?void 0:t.enableFieldEnumeration}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Field Enumeration"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"isOnboardingForm",onChange:T=>{i({isOnboardingForm:T.value}),A(T)},checked:t==null?void 0:t.isOnboardingForm}),o.jsx("label",{htmlFor:"isOnboardingForm",children:"Is Onboarding Form"})]})]}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"8rem"})}):o.jsxs(hi,{className:"mt-3",header:"Auto Save Settings",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({enableAutoSave:T.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save User Data"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"auto-save",onChange:T=>{i({enableAutoSaveBuilderSetting:T.value})},checked:t==null?void 0:t.enableAutoSaveBuilderSetting}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Form Builder Settings"})]})]}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"16rem"})}):o.jsxs(hi,{className:"mt-3",header:"Form Table Configuration",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"stripedRows",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,stripedRows:T.value}})},checked:(x=t==null?void 0:t.tableConfiguration)==null?void 0:x.stripedRows}),o.jsx("label",{htmlFor:"stripedRows",children:"Striped Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"gridLines",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,gridLines:T.value}})},checked:(S=t==null?void 0:t.tableConfiguration)==null?void 0:S.gridLines}),o.jsx("label",{htmlFor:"gridLines",children:"Grid Lines"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"flexScroll",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,flexScroll:T.value}})},checked:(E=t==null?void 0:t.tableConfiguration)==null?void 0:E.flexScroll}),o.jsx("label",{htmlFor:"flexScroll",children:"Flex Scroll "})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"isResponsive",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,isResponsive:T.value}})},checked:(C=t==null?void 0:t.tableConfiguration)==null?void 0:C.isResponsive}),o.jsx("label",{htmlFor:"isResponsive",children:"isResponsive Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:"rowReorder",onChange:T=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,rowReorder:T.value}})},checked:(_=t==null?void 0:t.tableConfiguration)==null?void 0:_.rowReorder}),o.jsx("label",{htmlFor:"rowReorder",children:"Row Reorder"})]})]})]}),o.jsxs("div",{className:"col-6",children:[s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{height:"18rem"})}):o.jsx(hi,{header:"Languages",children:iQ.map((T,O)=>{const F=n.filter(function(B){return(T==null?void 0:T.key)===(B==null?void 0:B.key)});return o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ks,{inputId:O,name:"lagnuage",checked:F.length>0,onChange:B=>v(B,T)}),o.jsx("label",{htmlFor:O,children:T.language})]},O)})}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"16rem"})}):o.jsxs(hi,{className:"mt-3",header:"Versioning",children:[o.jsx("h5",{children:"Change Form Version Title"}),o.jsx("div",{className:"field",children:o.jsx(gn,{value:(t==null?void 0:t.version_name)||"",minLength:2,placeholder:"Enter form version",maxLength:50,onChange:T=>{var O;i({version_name:(O=T==null?void 0:T.target)==null?void 0:O.value})}})}),o.jsx("h5",{children:"All Forms Version"}),o.jsx(Wxe,{}),o.jsx(kt,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>w(),label:"Create New Version",loading:s})]}),s===!0?o.jsx(o.Fragment,{children:o.jsx(da,{className:"mt-3",height:"8rem"})}):o.jsx(hi,{className:"mt-3",header:"Export/Import",children:o.jsxs("span",{className:"flex",children:[o.jsx(Jxe,{}),o.jsx(Qxe,{})]})})]}),o.jsx("div",{className:"col-6"})]})})})},aCe=t=>{var g,v,A;const{fieldIndex:e,field:n,models:r,setfieldMappings:i,fieldMappings:a}=t,[s,l]=N.useState(null),[c,u]=N.useState(null),d=()=>{var S;const w=[...a],x=w.findIndex(E=>E.fieldId===(n==null?void 0:n.uuid));if(x!==-1){const E=[...r],C=E.findIndex(_=>{var T;return _.modelName===((T=w[x])==null?void 0:T.modelName)});u((S=w[x])==null?void 0:S.column_name),C!==-1&&l(E[C])}};N.useEffect(()=>(d(),()=>{}),[]);const[f,h]=N.useState(!1),m=w=>{const x=[...a],S=x.findIndex(C=>C.fieldId===w),E={fieldId:w,modelName:(s==null?void 0:s.modelName)||"",class:s==null?void 0:s.class,column_name:c||""};S!==-1?x[S]=E:x.push(E),i([...x])};return o.jsxs("div",{className:"grid",children:[o.jsxs(As,{header:`Map ${(g=n==null?void 0:n.label)==null?void 0:g.english} Field with Model`,visible:f,style:{width:"40vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsx(kt,{text:!0,label:"Set Field","aria-label":"Submit",onClick:()=>{m((n==null?void 0:n.uuid)||""),h(!1)}})}),onHide:()=>h(!1),children:[o.jsxs("p",{children:["Map ",(v=n==null?void 0:n.label)==null?void 0:v.english," Field with Model"]}),o.jsxs("div",{className:"flex justify-content-between",children:[o.jsx(xa,{value:s,onChange:w=>l(w.value),options:r,optionLabel:"modelName",className:"w-full md:w-14rem",placeholder:"Select a model field",filter:!0,showClear:!0}),o.jsx(xa,{value:c,onChange:w=>u(w.value),options:(s==null?void 0:s.columns)||[],className:"w-full md:w-14rem",placeholder:"Select a column",filter:!0,showClear:!0})]})]}),o.jsx("div",{className:"col-6",children:o.jsxs("p",{children:[o.jsxs("strong",{children:[e+1," "]}),"Field ",n==null?void 0:n.componentType,": ",(A=n==null?void 0:n.label)==null?void 0:A.english," Is Mapped to"," ",o.jsx(_c,{className:"mr-2",severity:s!=null&&s.modelName?"success":"warning",value:(s==null?void 0:s.modelName)||"Nothing"}),"with column"," ",o.jsx(_c,{className:"mr-2",severity:c?"success":"danger",value:c||"Nothing"})]})}),o.jsx("div",{className:"col-6",children:o.jsx(kt,{text:!0,label:"Set Model","aria-label":"Submit",onClick:()=>{h(!0)}})})]},e+"-table-field-item")},sCe=t=>{const{fields:e}=t,[n]=N.useState([]),[r,i]=N.useState(!1),{formBuilderFormSchema:a,schemaBuilderUpdate:s}=ln(),l=()=>{i(!0)},c=()=>{let d=[...(a==null?void 0:a.fieldMappings)||[]];console.log("tempFieldsMappings",d),d!=null&&d.length&&(d=d==null?void 0:d.filter(f=>e.some(h=>h.uuid===(f==null?void 0:f.fieldId)))),u(d)};N.useEffect(()=>(l(),c(),()=>{}),[]);const u=d=>{s({fieldMappings:d})};return o.jsx("div",{children:r===!0?o.jsxs(o.Fragment,{children:[o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"}),o.jsx(da,{className:"mt-3",height:"5rem"})]}):o.jsx(o.Fragment,{children:(e==null?void 0:e.length)>0&&(n==null?void 0:n.length)>0&&(e==null?void 0:e.map((d,f)=>o.jsx("div",{className:"card",children:o.jsx(aCe,{fieldMappings:a!=null&&a.fieldMappings?a==null?void 0:a.fieldMappings:[],setfieldMappings:u,field:d,fieldIndex:f,models:n})},f+"-table-field-itemc-component")))})})},oCe=0,lCe=t=>{const{setShowPreview:e,activeIndex:n,userFormBuilderSettings:r}=t,{builderIsChangesSaved:i,builderTemplateName:a,formBuilderConfigurationType:s,formBuilderFormSchema:l,formBuilderLoading:c,formBuilderPublishedStatus:u,builderVersionName:d,saveFormProgress:f,schemaBuilderUpdate:h}=ln(),m=N.useRef(null),g=()=>{f(l)},v=["Basic","Advanced"],[A,w]=N.useState((r==null?void 0:r.isAdvanceView)!==void 0&&r!=null&&r.isAdvanceView?"Advanced":"Basic"),x=C=>{w(C.value),h({isAdvanceView:C.value==="Advanced"})},S=o.jsx(N.Fragment,{children:o.jsxs("div",{className:"flex",children:[((s==null?void 0:s.key)===O7||(s==null?void 0:s.key)===N7||(s==null?void 0:s.key)===tse)&&o.jsx(q0,{className:"mr-3",value:A,onChange:C=>x(C),options:v,disabled:c}),o.jsx(kt,{text:!0,icon:"pi pi-eye",size:"small",className:"mr-2",onClick:()=>e(!0),label:"Preview"}),!u&&o.jsx(o.Fragment,{children:(l==null?void 0:l.enableAutoSaveBuilderSetting)===!1&&o.jsx(kt,{text:!0,disabled:i,size:"small",className:i?"p-button-secondary":"p-button-info",onClick:()=>g(),label:"Save Progress",loading:c})})]})}),E=o.jsx(N.Fragment,{children:c===!0?o.jsx(o.Fragment,{children:o.jsx(da,{width:"25rem",height:"1.5rem"})}):o.jsxs("div",{className:"font-medium text-900",children:["Builder - ",s==null?void 0:s.name," - ",a," ","- Version : ",d]})});return o.jsxs(o.Fragment,{children:[o.jsx(i3,{ref:m}),o.jsxs("div",{className:"flex",children:[o.jsx("div",{className:"flex w-5 justify-content-left align-items-start",children:E}),o.jsx("div",{className:"flex w-7 justify-content-right align-items-end",children:n===oCe&&S})]})]})};function cCe(){const{formBuilderFormLayout:t,formBuilderFormSchema:e,clearBuilderSchema:n,schemaBuilderUpdate:r,saveFormProgress:i,userSelectedLanguage:a,builderIsChangesSaved:s}=ln(),l=u$(),c=l==null?void 0:l.form_template_id,[u]=N.useState(!0),[d]=N.useState(null),[f,h]=N.useState(!0),[m,g]=N.useState(!1),[v,A]=N.useState(0),[w,x]=N.useState(null),S=async()=>{},E=N.useCallback(()=>{S()},[t,e]),C=O=>{const F={...e,intro:O};r(F)},_=()=>{i(e)},T=()=>{s===!1?MD({message:"You have unsaved changes, would you like to to save them or discard them?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{_(),h(!1),setTimeout(()=>{n()},1e3)},rejectLabel:"Close and discard changes",acceptLabel:"Close and save changes",reject:()=>{h(!1),setTimeout(()=>{n()},1e3)}}):(h(!1),setTimeout(()=>{n()},1e3))};return o.jsx(As,{maximizable:!0,header:()=>o.jsx(lCe,{setUserFormBuilderSettings:x,userFormBuilderSettings:w,formBuilderFormLayout:t,formTemplateId:c,showPreview:m,setShowPreview:g,activeIndex:v,emitSocketData:E}),visible:f,style:{width:"100vw",height:"100vh",maxHeight:"100%"},onHide:()=>T(),children:o.jsxs("div",{id:"form-builder",className:"grid",style:{overflow:"hidden",height:"100%"},children:[!u&&o.jsx(kt,{text:!0,label:"Request Access",onClick:()=>{},className:"p-button-info"}),d&&o.jsxs("div",{children:[d==null?void 0:d.username," is editing so you have to wait to edits and leaves."]}),o.jsx("div",{className:"flex justify-content-end"}),o.jsx("div",{id:"users-arrow"}),o.jsx("div",{className:"col-12",style:{overflow:"hidden"},children:o.jsxs(Ka,{activeIndex:v,onTabChange:O=>A(O.index),children:[o.jsxs(hr,{header:"Builder",children:[o.jsx(sf,{backend:lf}),o.jsx(Io,{style:{width:"75vw"},visible:m,onHide:()=>g(!1),position:"right",children:o.jsx(sf,{backend:lf,children:o.jsx("div",{className:"scroll-height-200"})})})]}),o.jsx(hr,{header:"Configuration",children:o.jsx("div",{className:"scroll-height-250",children:o.jsx(iCe,{})})}),o.jsx(hr,{header:"Intro",disabled:(e==null?void 0:e.showIntroTab)===!1,children:o.jsx(u4,{style:{height:"320px"},value:(e==null?void 0:e.intro)||"<p></p>",onTextChange:O=>{C(O==null?void 0:O.htmlValue)}})}),o.jsx(hr,{header:"Data Model Binding",children:o.jsx(sCe,{fields:e==null?void 0:e.tableFields})}),o.jsxs(hr,{header:"Weighting",children:[o.jsx("h3",{children:"Weighting"}),(t==null?void 0:t.length)>0&&t.map((O,F)=>{var B,M,z;return o.jsxs("div",{children:[o.jsx("h5",{children:(B=O==null?void 0:O.title)==null?void 0:B[a==null?void 0:a.type]}),((M=O==null?void 0:O.children)==null?void 0:M.length)>0&&((z=O==null?void 0:O.children)==null?void 0:z.map((P,H)=>o.jsx("div",{children:o.jsx(Gxe,{page:O,section:P})},`weighting-section-${H}`)))]},`weighting-page-${F}`)}),o.jsx("hr",{}),"Total ",o.jsx(Na,{placeholder:"0",readOnly:!0})," %"]})]})})]})})}const uCe=()=>o.jsx(cCe,{}),dCe=t=>{const{className:e=""}=t,{builderIsChangesSaved:n,schemaBuilderUpdate:r,formBuilderFormLayout:i,formBuilderFormSchema:a,formatTableFieldsHook:s,formBuilderLoading:l,saveFormProgress:c}=ln(),u=d=>{n===!1?(d.preventDefault(),d.returnValue=!1):window.location.reload()};return N.useEffect(()=>(window.addEventListener("beforeunload",u),()=>{window.removeEventListener("beforeunload",u)}),[n]),N.useEffect(()=>((a==null?void 0:a.enableAutoSaveBuilderSetting)===!0&&l===!1?c(!1):r({isChangesSaved:!1}),s(i),()=>{}),[i]),o.jsx("div",{className:e,children:o.jsx(E5,{})})},fCe={padding:"1rem 0.5rem",cursor:"move",textAlign:"center"},Dh=t=>{const{data:e,showIcon:n,tags:r}=t,[{opacity:i},a]=Ji({type:tr,item:e,collect:l=>({opacity:l.isDragging()?0:1})});function s(l,c){return l.length<=c?l:l.slice(0,c)+"..."}return o.jsxs("div",{ref:a,className:`card shadow-2 question builder-sidebar-item ${e==null?void 0:e.element}`,style:{...fCe,opacity:i},children:[i&&(e!=null&&e.toolTip)?e==null?void 0:e.toolTip(e):"",s(e==null?void 0:e.label,80),o.jsxs("div",{className:"mt-2",children:[n&&o.jsx(_c,{icon:"pi pi-check",severity:"warning",className:"mr-2",rounded:!0}),r&&o.jsx(o.Fragment,{children:(r==null?void 0:r.length)>0&&(r==null?void 0:r.map((l,c)=>o.jsx(_c,{severity:l==null?void 0:l.severity,className:"mr-2",value:l==null?void 0:l.label},`tagIndex-${c}`)))})]})]})},hCe=()=>{const{renderType:t}=tn();return o.jsx(o.Fragment,{children:o.jsxs(Ka,{children:[t===Jh&&o.jsx(hr,{header:"Survey",children:tQ.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===H1||t===dm)&&o.jsx(hr,{header:"Form",children:ZW.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"xl:col-6 lg:col-12 md:col-12 sm:col-12",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===I9||t===jC||t===Zh)&&o.jsx(hr,{header:"Layout",children:RY.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===Jh||t===H1||t===dm)&&o.jsx(hr,{header:"Layout",children:eQ.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),t===ep&&o.jsx(hr,{header:"Question Bank",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-12",children:XY.map((e,n)=>o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>{const a=Et.cloneDeep(r);return o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:a},r.uuid)},"form_elements_"+i)})},`new-quiz-${n}`))}),o.jsx("div",{className:"col-12 ",children:o.jsxs("div",{className:"p-inputgroup",children:[o.jsx(gn,{placeholder:"Keyword"}),o.jsx(kt,{icon:"pi pi-search",className:"p-button-info"})]})})]})}),t===_9&&o.jsx(hr,{header:"Training",children:nQ.map((e,n)=>o.jsx(hi,{header:e==null?void 0:e.label,toggleable:!0,style:{marginBottom:10},children:o.jsx("div",{className:"grid",children:e==null?void 0:e.items.map((r,i)=>o.jsx("div",{className:"col-6",children:o.jsx(Dh,{data:r},r.uuid)},"form_elements_"+i))})},`pannel-tab-${n}`))}),(t===Jh||t===H1||t===dm)&&o.jsxs(hr,{header:"Custom",children:[o.jsx("h6",{children:"Custom Sections"}),o.jsx("div",{className:"grid"}),o.jsx("h6",{children:"Custom Matrix"}),o.jsx("div",{className:"grid"})]})]})})};function f$(t){return t}function pCe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var gCe=800,mCe=16,vCe=Date.now;function bCe(t){var e=0,n=0;return function(){var r=vCe(),i=mCe-(r-n);if(n=r,i>0){if(++e>=gCe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function yCe(t){return function(){return t}}var ACe=X3?function(t,e){return X3(t,"toString",{configurable:!0,enumerable:!1,value:yCe(e),writable:!0})}:f$,wCe=bCe(ACe),h$=Math.max;function SCe(t,e,n){return e=h$(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=h$(r.length-e,0),s=Array(a);++i<a;)s[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=n(s),pCe(t,this,l)}}function xCe(t,e){return wCe(SCe(t,e,f$),t+"")}function CCe(t,e,n){if(!e0(n))return!1;var r=typeof e;return(r=="number"?R3(n)&&CN(e,n.length):r=="string"&&e in n)?l2(n[e],t):!1}function TCe(t){return xCe(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&CCe(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var l=n[r];l&&t(e,l,r,a)}return e})}var ECe="__lodash_hash_undefined__";function ICe(t){return this.__data__.set(t,ECe),this}function _Ce(t){return this.__data__.has(t)}function D5(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new od;++e<n;)this.add(t[e])}D5.prototype.add=D5.prototype.push=ICe,D5.prototype.has=_Ce;function DCe(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function OCe(t,e){return t.has(e)}var NCe=1,FCe=2;function p$(t,e,n,r,i,a){var s=n&NCe,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,m=n&FCe?new D5:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var g=t[f],v=e[f];if(r)var A=s?r(v,g,f,e,t,a):r(g,v,f,t,e,a);if(A!==void 0){if(A)continue;h=!1;break}if(m){if(!DCe(e,function(w,x){if(!OCe(m,x)&&(g===w||i(g,w,n,r,a)))return m.push(x)})){h=!1;break}}else if(!(g===v||i(g,v,n,r,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function kCe(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function PCe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var MCe=1,LCe=2,BCe="[object Boolean]",VCe="[object Date]",UCe="[object Error]",qCe="[object Map]",jCe="[object Number]",$Ce="[object RegExp]",HCe="[object Set]",zCe="[object String]",YCe="[object Symbol]",KCe="[object ArrayBuffer]",XCe="[object DataView]",g$=cu?cu.prototype:void 0,wS=g$?g$.valueOf:void 0;function RCe(t,e,n,r,i,a,s){switch(n){case XCe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case KCe:return!(t.byteLength!=e.byteLength||!a(new G3(t),new G3(e)));case BCe:case VCe:case jCe:return l2(+t,+e);case UCe:return t.name==e.name&&t.message==e.message;case $Ce:case zCe:return t==e+"";case qCe:var l=kCe;case HCe:var c=r&MCe;if(l||(l=PCe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=LCe,s.set(t,e);var d=p$(l(t),l(e),r,i,a,s);return s.delete(t),d;case YCe:if(wS)return wS.call(t)==wS.call(e)}return!1}var GCe=1,WCe=Object.prototype,QCe=WCe.hasOwnProperty;function JCe(t,e,n,r,i,a){var s=n&GCe,l=J7(t),c=l.length,u=J7(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:QCe.call(e,h)))return!1}var m=a.get(t),g=a.get(e);if(m&&g)return m==e&&g==t;var v=!0;a.set(t,e),a.set(e,t);for(var A=s;++f<c;){h=l[f];var w=t[h],x=e[h];if(r)var S=s?r(x,w,h,e,t,a):r(w,x,h,t,e,a);if(!(S===void 0?w===x||i(w,x,n,r,a):S)){v=!1;break}A||(A=h=="constructor")}if(v&&!A){var E=t.constructor,C=e.constructor;E!=C&&"constructor"in t&&"constructor"in e&&!(typeof E=="function"&&E instanceof E&&typeof C=="function"&&C instanceof C)&&(v=!1)}return a.delete(t),a.delete(e),v}var ZCe=1,m$="[object Arguments]",v$="[object Array]",O5="[object Object]",eTe=Object.prototype,b$=eTe.hasOwnProperty;function tTe(t,e,n,r,i,a){var s=ld(t),l=ld(e),c=s?v$:g2(t),u=l?v$:g2(e);c=c==m$?O5:c,u=u==m$?O5:u;var d=c==O5,f=u==O5,h=c==u;if(h&&f2(t)){if(!f2(e))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new du),s||X7(t)?p$(t,e,n,r,i,a):RCe(t,e,c,n,r,i,a);if(!(n&ZCe)){var m=d&&b$.call(t,"__wrapped__"),g=f&&b$.call(e,"__wrapped__");if(m||g){var v=m?t.value():t,A=g?e.value():e;return a||(a=new du),i(v,A,n,r,a)}}return h?(a||(a=new du),JCe(t,e,n,r,i,a)):!1}function y$(t,e,n,r,i){return t===e?!0:t==null||e==null||!uu(t)&&!uu(e)?t!==t&&e!==e:tTe(t,e,n,r,y$,i)}function nTe(t){return function(e,n,r){for(var i=-1,a=Object(e),s=r(e),l=s.length;l--;){var c=s[t?l:++i];if(n(a[c],c,a)===!1)break}return e}}var rTe=nTe();function SS(t,e,n){(n!==void 0&&!l2(t[e],n)||n===void 0&&!(e in t))&&H7(t,e,n)}function iTe(t){return uu(t)&&R3(t)}function xS(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function aTe(t){return d2(t,p2(t))}function sTe(t,e,n,r,i,a,s){var l=xS(t,n),c=xS(e,n),u=s.get(c);if(u){SS(t,n,u);return}var d=a?a(l,c,n+"",t,e,s):void 0,f=d===void 0;if(f){var h=ld(c),m=!h&&f2(c),g=!h&&!m&&X7(c);d=c,h||m||g?ld(l)?d=l:iTe(l)?d=W7(l):m?(f=!1,d=kN(c,!0)):g?(f=!1,d=KN(c,!0)):d=[]:q7(c)||z7(c)?(d=l,z7(l)?d=aTe(l):(!e0(l)||j7(l))&&(d=RN(c))):f=!1}f&&(s.set(c,d),i(d,c,r,a,s),s.delete(c)),SS(t,n,d)}function A$(t,e,n,r,i){t!==e&&rTe(e,function(a,s){if(i||(i=new du),e0(a))sTe(t,e,s,n,A$,r,i);else{var l=r?r(xS(t,s),a,s+"",t,e,i):void 0;l===void 0&&(l=a),SS(t,s,l)}},p2)}function CS(t,e){return y$(t,e)}var m0=TCe(function(t,e,n){A$(t,e,n)}),ir=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(ir||{});class Ou{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const i=ir.TYPE&ir.ATTRIBUTE;this.scope=r.scope!=null?r.scope&ir.LEVEL|i:ir.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Oh extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const w$=class oC{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const i=this.query(n);if(i==null)throw new Oh(`Unable to create ${n} blot`);const a=i,s=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),l=new a(e,s,r);return oC.blots.set(l.domNode,l),l}find(e,n=!1){return oC.find(e,n)}query(e,n=ir.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&ir.LEVEL&ir.BLOCK?r=this.types.block:e&ir.LEVEL&ir.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&ir.LEVEL&r.scope&&n&ir.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,i="attrName"in n;if(!r&&!i)throw new Oh("Invalid definition");if(r&&n.blotName==="abstract")throw new Oh("Cannot register abstract class");const a=r?n.blotName:i?n.attrName:void 0;return this.types[a]=n,i?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(s=>s.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(s=>{(this.tags[s]==null||n.className==null)&&(this.tags[s]=n)}))),n})}};w$.blots=new WeakMap;let Nh=w$;function S$(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class oTe extends Ou{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){S$(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(S$(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const $c=oTe;function TS(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class lTe extends Ou{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[TS(this.keyName)]=n,!0):!1}remove(e){e.style[TS(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[TS(this.keyName)];return this.canAdd(e,n)?n:""}}const v0=lTe;class cTe{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Nh.find(this.domNode);if(e==null)return;const n=Ou.keys(this.domNode),r=$c.keys(this.domNode),i=v0.keys(this.domNode);n.concat(r).concat(i).forEach(a=>{const s=e.scroll.query(a,ir.ATTRIBUTE);s instanceof Ou&&(this.attributes[s.attrName]=s)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const N5=cTe,x$=class{constructor(e,n){this.scroll=e,this.domNode=n,Nh.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Oh("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Nh.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,i){const a=this.isolate(e,n);if(this.scroll.query(r,ir.BLOT)!=null&&i)a.wrap(r,i);else if(this.scroll.query(r,ir.ATTRIBUTE)!=null){const s=this.scroll.create(this.statics.scope);a.wrap(s),s.format(r,i)}}insertAt(e,n,r){const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(i,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Oh(`Cannot wrap ${e}`);return r.appendChild(this),r}};x$.blotName="abstract";let C$=x$;const T$=class extends C${static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};T$.scope=ir.INLINE_BLOT;const fo=T$;class uTe{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),i=0;for(;r;){if(r===e)return i;i+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let i=r();for(;i;){const a=i.length();if(e<a||n&&e===a&&(i.next==null||i.next.length()!==0))return[i,e];e-=a,i=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[i,a]=this.find(e);let s=e-a;const l=this.iterator(i);let c=l();for(;c&&s<e+n;){const u=c.length();e>s?r(c,e-s,Math.min(n,s+u-e)):r(c,0,Math.min(u,e+n-s)),s+=u,c=l()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let i=r();for(;i;)n=e(n,i),i=r();return n}}function E$(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(ir.INLINE);return Array.from(t.childNodes).forEach(i=>{r.domNode.appendChild(i)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const I$=class N0 extends C${constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,N0.uiClass&&this.uiNode.classList.add(N0.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new uTe,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=E$(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Oh)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,i,a)=>{r.deleteAt(i,a)})}descendant(e,n=0){const[r,i]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof N0?r.descendant(e,i):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(s,l,c)=>{(e.blotName==null&&e(s)||e.blotName!=null&&s instanceof e)&&i.push(s),s instanceof N0&&(i=i.concat(s.descendants(e,l,a))),a-=c}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===ir.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof N0?n.unwrap():n.remove())})}formatAt(e,n,r,i){this.children.forEachAt(e,n,(a,s,l)=>{a.formatAt(s,l,r,i)})}insertAt(e,n,r){const[i,a]=this.children.find(e);if(i)i.insertAt(a,n,r);else{const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(s)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,i]=this.children.find(e,n),a=[[this,e]];return r instanceof N0?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof N0&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,a,s)=>{const l=i.split(a,n);l!=null&&r.appendChild(l)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],i=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),i.push(...a.removedNodes))}),i.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const s=this.scroll.find(a);s!=null&&(s.domNode.parentNode==null||s.domNode.parentNode===this.domNode)&&s.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,s)=>a===s?0:a.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let s=null;a.nextSibling!=null&&(s=this.scroll.find(a.nextSibling));const l=E$(a,this.scroll);(l.next!==s||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,s||void 0))}),this.enforceAllowedChildren()}};I$.uiClass="";const Hc=I$;function dTe(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const Fh=class Qh extends Hc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Qh.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new N5(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof Qh||(r=r.wrap(Qh.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,ir.INLINE);if(r==null)return;r instanceof Ou?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.formats()[r]!=null||this.scroll.query(r,ir.ATTRIBUTE)?this.isolate(e,n).format(r,i):super.formatAt(e,n,r,i)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof Qh&&r.prev===this&&dTe(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof Qh&&this.attributes.move(r),r}};Fh.allowedChildren=[Fh,fo],Fh.blotName="inline",Fh.scope=ir.INLINE_BLOT,Fh.tagName="SPAN";const ES=Fh,kh=class lC extends Hc{static create(e){return super.create(e)}static formats(e,n){const r=n.query(lC.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new N5(this.domNode)}format(e,n){const r=this.scroll.query(e,ir.BLOCK);r!=null&&(r instanceof Ou?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(lC.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,i){this.scroll.query(r,ir.BLOCK)!=null?this.format(r,i):super.formatAt(e,n,r,i)}insertAt(e,n,r){if(r==null||this.scroll.query(n,ir.INLINE)!=null)super.insertAt(e,n,r);else{const i=this.split(e);if(i!=null){const a=this.scroll.create(n,r);i.parent.insertBefore(a,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};kh.blotName="block",kh.scope=ir.BLOCK_BLOT,kh.tagName="P",kh.allowedChildren=[ES,kh,fo];const Fg=kh,IS=class extends Hc{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,i){super.formatAt(e,n,r,i),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};IS.blotName="container",IS.scope=ir.BLOCK_BLOT;const F5=IS;class fTe extends fo{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,i){e===0&&n===this.length()?this.format(r,i):super.formatAt(e,n,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Cl=fTe,hTe={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},pTe=100,Ph=class extends Hc{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,hTe),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=ir.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,i){this.update(),super.formatAt(e,n,r,i)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const a=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&a(c.parent))},s=c=>{r.has(c.domNode)&&(c instanceof Hc&&c.children.forEach(s),r.delete(c.domNode),c.optimize(n))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=pTe)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const d=this.find(u.target,!0);d!=null&&(d.domNode===u.target&&(u.type==="childList"?(a(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(f=>{const h=this.find(f,!1);a(h,!1),h instanceof Hc&&h.children.forEach(m=>{a(m,!1)})})):u.type==="attributes"&&a(d.prev)),a(d))}),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const a=this.find(i.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(i),null):(r.set(a.domNode,[i]),a)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};Ph.blotName="scroll",Ph.defaultChild=Fg,Ph.allowedChildren=[Fg,F5],Ph.scope=ir.BLOCK_BLOT,Ph.tagName="DIV";const _S=Ph,DS=class yY extends fo{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof yY&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};DS.blotName="text",DS.scope=ir.INLINE_BLOT;const k5=DS,_$=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Ou,AttributorStore:N5,BlockBlot:Fg,ClassAttributor:$c,ContainerBlot:F5,EmbedBlot:Cl,InlineBlot:ES,LeafBlot:fo,ParentBlot:Hc,Registry:Nh,Scope:ir,ScrollBlot:_S,StyleAttributor:v0,TextBlot:k5},Symbol.toStringTag,{value:"Module"}));var OS={exports:{}},Tl=-1,Mo=1,Ss=0;function kg(t,e,n,r,i){if(t===e)return t?[[Ss,t]]:[];if(n!=null){var a=xTe(t,e,n);if(a)return a}var s=NS(t,e),l=t.substring(0,s);t=t.substring(s),e=e.substring(s),s=P5(t,e);var c=t.substring(t.length-s);t=t.substring(0,t.length-s),e=e.substring(0,e.length-s);var u=gTe(t,e);return l&&u.unshift([Ss,l]),c&&u.push([Ss,c]),FS(u,i),r&&bTe(u),u}function gTe(t,e){var n;if(!t)return[[Mo,e]];if(!e)return[[Tl,t]];var r=t.length>e.length?t:e,i=t.length>e.length?e:t,a=r.indexOf(i);if(a!==-1)return n=[[Mo,r.substring(0,a)],[Ss,i],[Mo,r.substring(a+i.length)]],t.length>e.length&&(n[0][0]=n[2][0]=Tl),n;if(i.length===1)return[[Tl,t],[Mo,e]];var s=vTe(t,e);if(s){var l=s[0],c=s[1],u=s[2],d=s[3],f=s[4],h=kg(l,u),m=kg(c,d);return h.concat([[Ss,f]],m)}return mTe(t,e)}function mTe(t,e){for(var n=t.length,r=e.length,i=Math.ceil((n+r)/2),a=i,s=2*i,l=new Array(s),c=new Array(s),u=0;u<s;u++)l[u]=-1,c[u]=-1;l[a+1]=0,c[a+1]=0;for(var d=n-r,f=d%2!==0,h=0,m=0,g=0,v=0,A=0;A<i;A++){for(var w=-A+h;w<=A-m;w+=2){var x=a+w,S;w===-A||w!==A&&l[x-1]<l[x+1]?S=l[x+1]:S=l[x-1]+1;for(var E=S-w;S<n&&E<r&&t.charAt(S)===e.charAt(E);)S++,E++;if(l[x]=S,S>n)m+=2;else if(E>r)h+=2;else if(f){var C=a+d-w;if(C>=0&&C<s&&c[C]!==-1){var _=n-c[C];if(S>=_)return D$(t,e,S,E)}}}for(var T=-A+g;T<=A-v;T+=2){var C=a+T,_;T===-A||T!==A&&c[C-1]<c[C+1]?_=c[C+1]:_=c[C-1]+1;for(var O=_-T;_<n&&O<r&&t.charAt(n-_-1)===e.charAt(r-O-1);)_++,O++;if(c[C]=_,_>n)v+=2;else if(O>r)g+=2;else if(!f){var x=a+d-T;if(x>=0&&x<s&&l[x]!==-1){var S=l[x],E=a+S-x;if(_=n-_,S>=_)return D$(t,e,S,E)}}}}return[[Tl,t],[Mo,e]]}function D$(t,e,n,r){var i=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=kg(i,a),u=kg(s,l);return c.concat(u)}function NS(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(a,i)==e.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return P$(t.charCodeAt(i-1))&&i--,i}function O$(t,e){var n=t.length,r=e.length;if(n==0||r==0)return 0;n>r?t=t.substring(n-r):n<r&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var a=0,s=1;;){var l=t.substring(i-s),c=e.indexOf(l);if(c==-1)return a;s+=c,(c==0||t.substring(i-s)==e.substring(0,s))&&(a=s,s++)}}function P5(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;n<i;)t.substring(t.length-i,t.length-a)==e.substring(e.length-i,e.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return M$(t.charCodeAt(t.length-i))&&i--,i}function vTe(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||r.length*2<n.length)return null;function i(m,g,v){for(var A=m.substring(v,v+Math.floor(m.length/4)),w=-1,x="",S,E,C,_;(w=g.indexOf(A,w+1))!==-1;){var T=NS(m.substring(v),g.substring(w)),O=P5(m.substring(0,v),g.substring(0,w));x.length<O+T&&(x=g.substring(w-O,w)+g.substring(w,w+T),S=m.substring(0,v-O),E=m.substring(v+T),C=g.substring(0,w-O),_=g.substring(w+T))}return x.length*2>=m.length?[S,E,C,_,x]:null}var a=i(n,r,Math.ceil(n.length/4)),s=i(n,r,Math.ceil(n.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var c,u,d,f;t.length>e.length?(c=l[0],u=l[1],d=l[2],f=l[3]):(d=l[0],f=l[1],c=l[2],u=l[3]);var h=l[4];return[c,u,d,f,h]}function bTe(t){for(var e=!1,n=[],r=0,i=null,a=0,s=0,l=0,c=0,u=0;a<t.length;)t[a][0]==Ss?(n[r++]=a,s=c,l=u,c=0,u=0,i=t[a][1]):(t[a][0]==Mo?c+=t[a][1].length:u+=t[a][1].length,i&&i.length<=Math.max(s,l)&&i.length<=Math.max(c,u)&&(t.splice(n[r-1],0,[Tl,i]),t[n[r-1]+1][0]=Mo,r--,r--,a=r>0?n[r-1]:-1,s=0,l=0,c=0,u=0,i=null,e=!0)),a++;for(e&&FS(t),wTe(t),a=1;a<t.length;){if(t[a-1][0]==Tl&&t[a][0]==Mo){var d=t[a-1][1],f=t[a][1],h=O$(d,f),m=O$(f,d);h>=m?(h>=d.length/2||h>=f.length/2)&&(t.splice(a,0,[Ss,f.substring(0,h)]),t[a-1][1]=d.substring(0,d.length-h),t[a+1][1]=f.substring(h),a++):(m>=d.length/2||m>=f.length/2)&&(t.splice(a,0,[Ss,d.substring(0,m)]),t[a-1][0]=Mo,t[a-1][1]=f.substring(0,f.length-m),t[a+1][0]=Tl,t[a+1][1]=d.substring(m),a++),a++}a++}}var N$=/[^a-zA-Z0-9]/,F$=/\s/,k$=/[\r\n]/,yTe=/\n\r?\n$/,ATe=/^\r?\n\r?\n/;function wTe(t){function e(m,g){if(!m||!g)return 6;var v=m.charAt(m.length-1),A=g.charAt(0),w=v.match(N$),x=A.match(N$),S=w&&v.match(F$),E=x&&A.match(F$),C=S&&v.match(k$),_=E&&A.match(k$),T=C&&m.match(yTe),O=_&&g.match(ATe);return T||O?5:C||_?4:w&&!S&&E?3:S||E?2:w||x?1:0}for(var n=1;n<t.length-1;){if(t[n-1][0]==Ss&&t[n+1][0]==Ss){var r=t[n-1][1],i=t[n][1],a=t[n+1][1],s=P5(r,i);if(s){var l=i.substring(i.length-s);r=r.substring(0,r.length-s),i=l+i.substring(0,i.length-s),a=l+a}for(var c=r,u=i,d=a,f=e(r,i)+e(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var h=e(r,i)+e(i,a);h>=f&&(f=h,c=r,u=i,d=a)}t[n-1][1]!=c&&(c?t[n-1][1]=c:(t.splice(n-1,1),n--),t[n][1]=u,d?t[n+1][1]=d:(t.splice(n+1,1),n--))}n++}}function FS(t,e){t.push([Ss,""]);for(var n=0,r=0,i=0,a="",s="",l;n<t.length;){if(n<t.length-1&&!t[n][1]){t.splice(n,1);continue}switch(t[n][0]){case Mo:i++,s+=t[n][1],n++;break;case Tl:r++,a+=t[n][1],n++;break;case Ss:var c=n-i-r-1;if(e){if(c>=0&&B$(t[c][1])){var u=t[c][1].slice(-1);if(t[c][1]=t[c][1].slice(0,-1),a=u+a,s=u+s,!t[c][1]){t.splice(c,1),n--;var d=c-1;t[d]&&t[d][0]===Mo&&(i++,s=t[d][1]+s,d--),t[d]&&t[d][0]===Tl&&(r++,a=t[d][1]+a,d--),c=d}}if(L$(t[n][1])){var u=t[n][1].charAt(0);t[n][1]=t[n][1].slice(1),a+=u,s+=u}}if(n<t.length-1&&!t[n][1]){t.splice(n,1);break}if(a.length>0||s.length>0){a.length>0&&s.length>0&&(l=NS(s,a),l!==0&&(c>=0?t[c][1]+=s.substring(0,l):(t.splice(0,0,[Ss,s.substring(0,l)]),n++),s=s.substring(l),a=a.substring(l)),l=P5(s,a),l!==0&&(t[n][1]=s.substring(s.length-l)+t[n][1],s=s.substring(0,s.length-l),a=a.substring(0,a.length-l)));var f=i+r;a.length===0&&s.length===0?(t.splice(n-f,f),n=n-f):a.length===0?(t.splice(n-f,f,[Mo,s]),n=n-f+1):s.length===0?(t.splice(n-f,f,[Tl,a]),n=n-f+1):(t.splice(n-f,f,[Tl,a],[Mo,s]),n=n-f+2)}n!==0&&t[n-1][0]===Ss?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,i=0,r=0,a="",s="";break}}t[t.length-1][1]===""&&t.pop();var h=!1;for(n=1;n<t.length-1;)t[n-1][0]===Ss&&t[n+1][0]===Ss&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)===t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),h=!0):t[n][1].substring(0,t[n+1][1].length)==t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),h=!0)),n++;h&&FS(t,e)}function P$(t){return t>=55296&&t<=56319}function M$(t){return t>=56320&&t<=57343}function L$(t){return M$(t.charCodeAt(0))}function B$(t){return P$(t.charCodeAt(t.length-1))}function STe(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}function kS(t,e,n,r){return B$(t)||L$(r)?null:STe([[Ss,t],[Tl,e],[Mo,n],[Ss,r]])}function xTe(t,e,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,i=typeof n=="number"?null:n.newRange,a=t.length,s=e.length;if(r.length===0&&(i===null||i.length===0)){var l=r.index,c=t.slice(0,l),u=t.slice(l),d=i?i.index:null;e:{var f=l+s-a;if(d!==null&&d!==f||f<0||f>s)break e;var h=e.slice(0,f),m=e.slice(f);if(m!==u)break e;var g=Math.min(l,f),v=c.slice(0,g),A=h.slice(0,g);if(v!==A)break e;var w=c.slice(g),x=h.slice(g);return kS(v,w,x,u)}e:{if(d!==null&&d!==l)break e;var S=l,h=e.slice(0,S),m=e.slice(S);if(h!==c)break e;var E=Math.min(a-S,s-S),C=u.slice(u.length-E),_=m.slice(m.length-E);if(C!==_)break e;var w=u.slice(0,u.length-E),x=m.slice(0,m.length-E);return kS(c,w,x,C)}}if(r.length>0&&i&&i.length===0)e:{var v=t.slice(0,r.index),C=t.slice(r.index+r.length),g=v.length,E=C.length;if(s<g+E)break e;var A=e.slice(0,g),_=e.slice(s-E);if(v!==A||C!==_)break e;var w=t.slice(g,a-E),x=e.slice(g,s-E);return kS(v,w,x,C)}return null}function M5(t,e,n,r){return kg(t,e,n,r,!0)}M5.INSERT=Mo,M5.DELETE=Tl,M5.EQUAL=Ss;var CTe=M5,L5={exports:{}};L5.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",d="[object Function]",f="[object GeneratorFunction]",h="[object Map]",m="[object Number]",g="[object Object]",v="[object Promise]",A="[object RegExp]",w="[object Set]",x="[object String]",S="[object Symbol]",E="[object WeakMap]",C="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",O="[object Float64Array]",F="[object Int8Array]",B="[object Int16Array]",M="[object Int32Array]",z="[object Uint8Array]",P="[object Uint8ClampedArray]",H="[object Uint16Array]",de="[object Uint32Array]",fe=/[\\^$.*+?()[\]{}|]/g,ne=/\w*$/,W=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,Y={};Y[a]=Y[s]=Y[C]=Y[_]=Y[l]=Y[c]=Y[T]=Y[O]=Y[F]=Y[B]=Y[M]=Y[h]=Y[m]=Y[g]=Y[A]=Y[w]=Y[x]=Y[S]=Y[z]=Y[P]=Y[H]=Y[de]=!0,Y[u]=Y[d]=Y[E]=!1;var pe=typeof Ni=="object"&&Ni&&Ni.Object===Object&&Ni,ie=typeof self=="object"&&self&&self.Object===Object&&self,J=pe||ie||Function("return this")(),Q=e&&!e.nodeType&&e,oe=Q&&!0&&t&&!t.nodeType&&t,ye=oe&&oe.exports===Q;function Te(ee,ke){return ee.set(ke[0],ke[1]),ee}function Ae(ee,ke){return ee.add(ke),ee}function be(ee,ke){for(var Ze=-1,Ut=ee?ee.length:0;++Ze<Ut&&ke(ee[Ze],Ze,ee)!==!1;);return ee}function we(ee,ke){for(var Ze=-1,Ut=ke.length,or=ee.length;++Ze<Ut;)ee[or+Ze]=ke[Ze];return ee}function re(ee,ke,Ze,Ut){var or=-1,Gn=ee?ee.length:0;for(Ut&&Gn&&(Ze=ee[++or]);++or<Gn;)Ze=ke(Ze,ee[or],or,ee);return Ze}function U(ee,ke){for(var Ze=-1,Ut=Array(ee);++Ze<ee;)Ut[Ze]=ke(Ze);return Ut}function Z(ee,ke){return ee==null?void 0:ee[ke]}function K(ee){var ke=!1;if(ee!=null&&typeof ee.toString!="function")try{ke=!!(ee+"")}catch{}return ke}function he(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut,or){Ze[++ke]=[or,Ut]}),Ze}function _e(ee,ke){return function(Ze){return ee(ke(Ze))}}function ge(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut){Ze[++ke]=Ut}),Ze}var ve=Array.prototype,Le=Function.prototype,Ne=Object.prototype,me=J["__core-js_shared__"],V=function(){var ee=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return ee?"Symbol(src)_1."+ee:""}(),te=Le.toString,X=Ne.hasOwnProperty,se=Ne.toString,ue=RegExp("^"+te.call(X).replace(fe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=ye?J.Buffer:void 0,De=J.Symbol,je=J.Uint8Array,ct=_e(Object.getPrototypeOf,Object),Dt=Object.create,nt=Ne.propertyIsEnumerable,xt=ve.splice,rt=Object.getOwnPropertySymbols,mt=Se?Se.isBuffer:void 0,Ot=_e(Object.keys,Object),$e=Zt(J,"DataView"),St=Zt(J,"Map"),Kt=Zt(J,"Promise"),An=Zt(J,"Set"),yn=Zt(J,"WeakMap"),vn=Zt(Object,"create"),On=Dn($e),Jn=Dn(St),Cn=Dn(Kt),jt=Dn(An),st=Dn(yn),et=De?De.prototype:void 0,dt=et?et.valueOf:void 0;function Ht(ee){var ke=-1,Ze=ee?ee.length:0;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Tn(){this.__data__=vn?vn(null):{}}function kn(ee){return this.has(ee)&&delete this.__data__[ee]}function Rn(ee){var ke=this.__data__;if(vn){var Ze=ke[ee];return Ze===r?void 0:Ze}return X.call(ke,ee)?ke[ee]:void 0}function cr(ee){var ke=this.__data__;return vn?ke[ee]!==void 0:X.call(ke,ee)}function Zn(ee,ke){var Ze=this.__data__;return Ze[ee]=vn&&ke===void 0?r:ke,this}Ht.prototype.clear=Tn,Ht.prototype.delete=kn,Ht.prototype.get=Rn,Ht.prototype.has=cr,Ht.prototype.set=Zn;function vr(ee){var ke=-1,Ze=ee?ee.length:0;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Ir(){this.__data__=[]}function dn(ee){var ke=this.__data__,Ze=Pe(ke,ee);if(Ze<0)return!1;var Ut=ke.length-1;return Ze==Ut?ke.pop():xt.call(ke,Ze,1),!0}function lt(ee){var ke=this.__data__,Ze=Pe(ke,ee);return Ze<0?void 0:ke[Ze][1]}function at(ee){return Pe(this.__data__,ee)>-1}function yt(ee,ke){var Ze=this.__data__,Ut=Pe(Ze,ee);return Ut<0?Ze.push([ee,ke]):Ze[Ut][1]=ke,this}vr.prototype.clear=Ir,vr.prototype.delete=dn,vr.prototype.get=lt,vr.prototype.has=at,vr.prototype.set=yt;function Vt(ee){var ke=-1,Ze=ee?ee.length:0;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Pt(){this.__data__={hash:new Ht,map:new(St||vr),string:new Ht}}function Ke(ee){return qi(this,ee).delete(ee)}function Oe(ee){return qi(this,ee).get(ee)}function Je(ee){return qi(this,ee).has(ee)}function ot(ee,ke){return qi(this,ee).set(ee,ke),this}Vt.prototype.clear=Pt,Vt.prototype.delete=Ke,Vt.prototype.get=Oe,Vt.prototype.has=Je,Vt.prototype.set=ot;function Lt(ee){this.__data__=new vr(ee)}function Gt(){this.__data__=new vr}function ft(ee){return this.__data__.delete(ee)}function Me(ee){return this.__data__.get(ee)}function Qe(ee){return this.__data__.has(ee)}function Ft(ee,ke){var Ze=this.__data__;if(Ze instanceof vr){var Ut=Ze.__data__;if(!St||Ut.length<n-1)return Ut.push([ee,ke]),this;Ze=this.__data__=new Vt(Ut)}return Ze.set(ee,ke),this}Lt.prototype.clear=Gt,Lt.prototype.delete=ft,Lt.prototype.get=Me,Lt.prototype.has=Qe,Lt.prototype.set=Ft;function zt(ee,ke){var Ze=Ua(ee)||ii(ee)?U(ee.length,String):[],Ut=Ze.length,or=!!Ut;for(var Gn in ee)(ke||X.call(ee,Gn))&&!(or&&(Gn=="length"||an(Gn,Ut)))&&Ze.push(Gn);return Ze}function At(ee,ke,Ze){var Ut=ee[ke];(!(X.call(ee,ke)&&Yr(Ut,Ze))||Ze===void 0&&!(ke in ee))&&(ee[ke]=Ze)}function Pe(ee,ke){for(var Ze=ee.length;Ze--;)if(Yr(ee[Ze][0],ke))return Ze;return-1}function Xe(ee,ke){return ee&&Ii(ke,po(ke),ee)}function Ct(ee,ke,Ze,Ut,or,Gn,_r){var Lr;if(Ut&&(Lr=Gn?Ut(ee,or,Gn,_r):Ut(ee)),Lr!==void 0)return Lr;if(!Ls(ee))return ee;var kr=Ua(ee);if(kr){if(Lr=Nn(ee),!ke)return ri(ee,Lr)}else{var Vr=Xt(ee),Zr=Vr==d||Vr==f;if(xs(ee))return Yn(ee,ke);if(Vr==g||Vr==a||Zr&&!Gn){if(K(ee))return Gn?ee:{};if(Lr=ar(Zr?{}:ee),!ke)return Da(ee,Xe(Lr,ee))}else{if(!Y[Vr])return Gn?ee:{};Lr=Jr(ee,Vr,Ct,ke)}}_r||(_r=new Lt);var Di=_r.get(ee);if(Di)return Di;if(_r.set(ee,Lr),!kr)var ji=Ze?_i(ee):po(ee);return be(ji||ee,function(Kr,Si){ji&&(Si=Kr,Kr=ee[Si]),At(Lr,Si,Ct(Kr,ke,Ze,Ut,Si,ee,_r))}),Lr}function qt(ee){return Ls(ee)?Dt(ee):{}}function Yt(ee,ke,Ze){var Ut=ke(ee);return Ua(ee)?Ut:we(Ut,Ze(ee))}function Pn(ee){return se.call(ee)}function Hn(ee){if(!Ls(ee)||Tt(ee))return!1;var ke=Cs(ee)||K(ee)?ue:W;return ke.test(Dn(ee))}function Tr(ee){if(!on(ee))return Ot(ee);var ke=[];for(var Ze in Object(ee))X.call(ee,Ze)&&Ze!="constructor"&&ke.push(Ze);return ke}function Yn(ee,ke){if(ke)return ee.slice();var Ze=new ee.constructor(ee.length);return ee.copy(Ze),Ze}function In(ee){var ke=new ee.constructor(ee.byteLength);return new je(ke).set(new je(ee)),ke}function Fr(ee,ke){var Ze=ke?In(ee.buffer):ee.buffer;return new ee.constructor(Ze,ee.byteOffset,ee.byteLength)}function Kn(ee,ke,Ze){var Ut=ke?Ze(he(ee),!0):he(ee);return re(Ut,Te,new ee.constructor)}function ur(ee){var ke=new ee.constructor(ee.source,ne.exec(ee));return ke.lastIndex=ee.lastIndex,ke}function Vn(ee,ke,Ze){var Ut=ke?Ze(ge(ee),!0):ge(ee);return re(Ut,Ae,new ee.constructor)}function gi(ee){return dt?Object(dt.call(ee)):{}}function li(ee,ke){var Ze=ke?In(ee.buffer):ee.buffer;return new ee.constructor(Ze,ee.byteOffset,ee.length)}function ri(ee,ke){var Ze=-1,Ut=ee.length;for(ke||(ke=Array(Ut));++Ze<Ut;)ke[Ze]=ee[Ze];return ke}function Ii(ee,ke,Ze,Ut){Ze||(Ze={});for(var or=-1,Gn=ke.length;++or<Gn;){var _r=ke[or],Lr=Ut?Ut(Ze[_r],ee[_r],_r,Ze,ee):void 0;At(Ze,_r,Lr===void 0?ee[_r]:Lr)}return Ze}function Da(ee,ke){return Ii(ee,Ue(ee),ke)}function _i(ee){return Yt(ee,po,Ue)}function qi(ee,ke){var Ze=ee.__data__;return Ye(ke)?Ze[typeof ke=="string"?"string":"hash"]:Ze.map}function Zt(ee,ke){var Ze=Z(ee,ke);return Hn(Ze)?Ze:void 0}var Ue=rt?_e(rt,Object):yi,Xt=Pn;($e&&Xt(new $e(new ArrayBuffer(1)))!=_||St&&Xt(new St)!=h||Kt&&Xt(Kt.resolve())!=v||An&&Xt(new An)!=w||yn&&Xt(new yn)!=E)&&(Xt=function(ee){var ke=se.call(ee),Ze=ke==g?ee.constructor:void 0,Ut=Ze?Dn(Ze):void 0;if(Ut)switch(Ut){case On:return _;case Jn:return h;case Cn:return v;case jt:return w;case st:return E}return ke});function Nn(ee){var ke=ee.length,Ze=ee.constructor(ke);return ke&&typeof ee[0]=="string"&&X.call(ee,"index")&&(Ze.index=ee.index,Ze.input=ee.input),Ze}function ar(ee){return typeof ee.constructor=="function"&&!on(ee)?qt(ct(ee)):{}}function Jr(ee,ke,Ze,Ut){var or=ee.constructor;switch(ke){case C:return In(ee);case l:case c:return new or(+ee);case _:return Fr(ee,Ut);case T:case O:case F:case B:case M:case z:case P:case H:case de:return li(ee,Ut);case h:return Kn(ee,Ut,Ze);case m:case x:return new or(ee);case A:return ur(ee);case w:return Vn(ee,Ut,Ze);case S:return gi(ee)}}function an(ee,ke){return ke=ke??i,!!ke&&(typeof ee=="number"||ae.test(ee))&&ee>-1&&ee%1==0&&ee<ke}function Ye(ee){var ke=typeof ee;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?ee!=="__proto__":ee===null}function Tt(ee){return!!V&&V in ee}function on(ee){var ke=ee&&ee.constructor,Ze=typeof ke=="function"&&ke.prototype||Ne;return ee===Ze}function Dn(ee){if(ee!=null){try{return te.call(ee)}catch{}try{return ee+""}catch{}}return""}function br(ee){return Ct(ee,!0,!0)}function Yr(ee,ke){return ee===ke||ee!==ee&&ke!==ke}function ii(ee){return Il(ee)&&X.call(ee,"callee")&&(!nt.call(ee,"callee")||se.call(ee)==a)}var Ua=Array.isArray;function fs(ee){return ee!=null&&Ms(ee.length)&&!Cs(ee)}function Il(ee){return _l(ee)&&fs(ee)}var xs=mt||Ai;function Cs(ee){var ke=Ls(ee)?se.call(ee):"";return ke==d||ke==f}function Ms(ee){return typeof ee=="number"&&ee>-1&&ee%1==0&&ee<=i}function Ls(ee){var ke=typeof ee;return!!ee&&(ke=="object"||ke=="function")}function _l(ee){return!!ee&&typeof ee=="object"}function po(ee){return fs(ee)?zt(ee):Tr(ee)}function yi(){return[]}function Ai(){return!1}t.exports=br}(L5,L5.exports);var V$=L5.exports,B5={exports:{}};B5.exports,function(t,e){var n=200,r="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",A="[object Number]",w="[object Null]",x="[object Object]",S="[object Promise]",E="[object Proxy]",C="[object RegExp]",_="[object Set]",T="[object String]",O="[object Symbol]",F="[object Undefined]",B="[object WeakMap]",M="[object ArrayBuffer]",z="[object DataView]",P="[object Float32Array]",H="[object Float64Array]",de="[object Int8Array]",fe="[object Int16Array]",ne="[object Int32Array]",W="[object Uint8Array]",ae="[object Uint8ClampedArray]",Y="[object Uint16Array]",pe="[object Uint32Array]",ie=/[\\^$.*+?()[\]{}|]/g,J=/^\[object .+?Constructor\]$/,Q=/^(?:0|[1-9]\d*)$/,oe={};oe[P]=oe[H]=oe[de]=oe[fe]=oe[ne]=oe[W]=oe[ae]=oe[Y]=oe[pe]=!0,oe[l]=oe[c]=oe[M]=oe[d]=oe[z]=oe[f]=oe[h]=oe[m]=oe[v]=oe[A]=oe[x]=oe[C]=oe[_]=oe[T]=oe[B]=!1;var ye=typeof Ni=="object"&&Ni&&Ni.Object===Object&&Ni,Te=typeof self=="object"&&self&&self.Object===Object&&self,Ae=ye||Te||Function("return this")(),be=e&&!e.nodeType&&e,we=be&&!0&&t&&!t.nodeType&&t,re=we&&we.exports===be,U=re&&ye.process,Z=function(){try{return U&&U.binding&&U.binding("util")}catch{}}(),K=Z&&Z.isTypedArray;function he(ee,ke){for(var Ze=-1,Ut=ee==null?0:ee.length,or=0,Gn=[];++Ze<Ut;){var _r=ee[Ze];ke(_r,Ze,ee)&&(Gn[or++]=_r)}return Gn}function _e(ee,ke){for(var Ze=-1,Ut=ke.length,or=ee.length;++Ze<Ut;)ee[or+Ze]=ke[Ze];return ee}function ge(ee,ke){for(var Ze=-1,Ut=ee==null?0:ee.length;++Ze<Ut;)if(ke(ee[Ze],Ze,ee))return!0;return!1}function ve(ee,ke){for(var Ze=-1,Ut=Array(ee);++Ze<ee;)Ut[Ze]=ke(Ze);return Ut}function Le(ee){return function(ke){return ee(ke)}}function Ne(ee,ke){return ee.has(ke)}function me(ee,ke){return ee==null?void 0:ee[ke]}function V(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut,or){Ze[++ke]=[or,Ut]}),Ze}function te(ee,ke){return function(Ze){return ee(ke(Ze))}}function X(ee){var ke=-1,Ze=Array(ee.size);return ee.forEach(function(Ut){Ze[++ke]=Ut}),Ze}var se=Array.prototype,ue=Function.prototype,Se=Object.prototype,De=Ae["__core-js_shared__"],je=ue.toString,ct=Se.hasOwnProperty,Dt=function(){var ee=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return ee?"Symbol(src)_1."+ee:""}(),nt=Se.toString,xt=RegExp("^"+je.call(ct).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=re?Ae.Buffer:void 0,mt=Ae.Symbol,Ot=Ae.Uint8Array,$e=Se.propertyIsEnumerable,St=se.splice,Kt=mt?mt.toStringTag:void 0,An=Object.getOwnPropertySymbols,yn=rt?rt.isBuffer:void 0,vn=te(Object.keys,Object),On=Ue(Ae,"DataView"),Jn=Ue(Ae,"Map"),Cn=Ue(Ae,"Promise"),jt=Ue(Ae,"Set"),st=Ue(Ae,"WeakMap"),et=Ue(Object,"create"),dt=Dn(On),Ht=Dn(Jn),Tn=Dn(Cn),kn=Dn(jt),Rn=Dn(st),cr=mt?mt.prototype:void 0,Zn=cr?cr.valueOf:void 0;function vr(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Ir(){this.__data__=et?et(null):{},this.size=0}function dn(ee){var ke=this.has(ee)&&delete this.__data__[ee];return this.size-=ke?1:0,ke}function lt(ee){var ke=this.__data__;if(et){var Ze=ke[ee];return Ze===r?void 0:Ze}return ct.call(ke,ee)?ke[ee]:void 0}function at(ee){var ke=this.__data__;return et?ke[ee]!==void 0:ct.call(ke,ee)}function yt(ee,ke){var Ze=this.__data__;return this.size+=this.has(ee)?0:1,Ze[ee]=et&&ke===void 0?r:ke,this}vr.prototype.clear=Ir,vr.prototype.delete=dn,vr.prototype.get=lt,vr.prototype.has=at,vr.prototype.set=yt;function Vt(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Pt(){this.__data__=[],this.size=0}function Ke(ee){var ke=this.__data__,Ze=Yn(ke,ee);if(Ze<0)return!1;var Ut=ke.length-1;return Ze==Ut?ke.pop():St.call(ke,Ze,1),--this.size,!0}function Oe(ee){var ke=this.__data__,Ze=Yn(ke,ee);return Ze<0?void 0:ke[Ze][1]}function Je(ee){return Yn(this.__data__,ee)>-1}function ot(ee,ke){var Ze=this.__data__,Ut=Yn(Ze,ee);return Ut<0?(++this.size,Ze.push([ee,ke])):Ze[Ut][1]=ke,this}Vt.prototype.clear=Pt,Vt.prototype.delete=Ke,Vt.prototype.get=Oe,Vt.prototype.has=Je,Vt.prototype.set=ot;function Lt(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.clear();++ke<Ze;){var Ut=ee[ke];this.set(Ut[0],Ut[1])}}function Gt(){this.size=0,this.__data__={hash:new vr,map:new(Jn||Vt),string:new vr}}function ft(ee){var ke=Zt(this,ee).delete(ee);return this.size-=ke?1:0,ke}function Me(ee){return Zt(this,ee).get(ee)}function Qe(ee){return Zt(this,ee).has(ee)}function Ft(ee,ke){var Ze=Zt(this,ee),Ut=Ze.size;return Ze.set(ee,ke),this.size+=Ze.size==Ut?0:1,this}Lt.prototype.clear=Gt,Lt.prototype.delete=ft,Lt.prototype.get=Me,Lt.prototype.has=Qe,Lt.prototype.set=Ft;function zt(ee){var ke=-1,Ze=ee==null?0:ee.length;for(this.__data__=new Lt;++ke<Ze;)this.add(ee[ke])}function At(ee){return this.__data__.set(ee,r),this}function Pe(ee){return this.__data__.has(ee)}zt.prototype.add=zt.prototype.push=At,zt.prototype.has=Pe;function Xe(ee){var ke=this.__data__=new Vt(ee);this.size=ke.size}function Ct(){this.__data__=new Vt,this.size=0}function qt(ee){var ke=this.__data__,Ze=ke.delete(ee);return this.size=ke.size,Ze}function Yt(ee){return this.__data__.get(ee)}function Pn(ee){return this.__data__.has(ee)}function Hn(ee,ke){var Ze=this.__data__;if(Ze instanceof Vt){var Ut=Ze.__data__;if(!Jn||Ut.length<n-1)return Ut.push([ee,ke]),this.size=++Ze.size,this;Ze=this.__data__=new Lt(Ut)}return Ze.set(ee,ke),this.size=Ze.size,this}Xe.prototype.clear=Ct,Xe.prototype.delete=qt,Xe.prototype.get=Yt,Xe.prototype.has=Pn,Xe.prototype.set=Hn;function Tr(ee,ke){var Ze=ii(ee),Ut=!Ze&&Yr(ee),or=!Ze&&!Ut&&fs(ee),Gn=!Ze&&!Ut&&!or&&_l(ee),_r=Ze||Ut||or||Gn,Lr=_r?ve(ee.length,String):[],kr=Lr.length;for(var Vr in ee)(ke||ct.call(ee,Vr))&&!(_r&&(Vr=="length"||or&&(Vr=="offset"||Vr=="parent")||Gn&&(Vr=="buffer"||Vr=="byteLength"||Vr=="byteOffset")||Jr(Vr,kr)))&&Lr.push(Vr);return Lr}function Yn(ee,ke){for(var Ze=ee.length;Ze--;)if(br(ee[Ze][0],ke))return Ze;return-1}function In(ee,ke,Ze){var Ut=ke(ee);return ii(ee)?Ut:_e(Ut,Ze(ee))}function Fr(ee){return ee==null?ee===void 0?F:w:Kt&&Kt in Object(ee)?Xt(ee):on(ee)}function Kn(ee){return Ls(ee)&&Fr(ee)==l}function ur(ee,ke,Ze,Ut,or){return ee===ke?!0:ee==null||ke==null||!Ls(ee)&&!Ls(ke)?ee!==ee&&ke!==ke:Vn(ee,ke,Ze,Ut,ur,or)}function Vn(ee,ke,Ze,Ut,or,Gn){var _r=ii(ee),Lr=ii(ke),kr=_r?c:ar(ee),Vr=Lr?c:ar(ke);kr=kr==l?x:kr,Vr=Vr==l?x:Vr;var Zr=kr==x,Di=Vr==x,ji=kr==Vr;if(ji&&fs(ee)){if(!fs(ke))return!1;_r=!0,Zr=!1}if(ji&&!Zr)return Gn||(Gn=new Xe),_r||_l(ee)?Ii(ee,ke,Ze,Ut,or,Gn):Da(ee,ke,kr,Ze,Ut,or,Gn);if(!(Ze&i)){var Kr=Zr&&ct.call(ee,"__wrapped__"),Si=Di&&ct.call(ke,"__wrapped__");if(Kr||Si){var ya=Kr?ee.value():ee,La=Si?ke.value():ke;return Gn||(Gn=new Xe),or(ya,La,Ze,Ut,Gn)}}return ji?(Gn||(Gn=new Xe),_i(ee,ke,Ze,Ut,or,Gn)):!1}function gi(ee){if(!Ms(ee)||Ye(ee))return!1;var ke=xs(ee)?xt:J;return ke.test(Dn(ee))}function li(ee){return Ls(ee)&&Cs(ee.length)&&!!oe[Fr(ee)]}function ri(ee){if(!Tt(ee))return vn(ee);var ke=[];for(var Ze in Object(ee))ct.call(ee,Ze)&&Ze!="constructor"&&ke.push(Ze);return ke}function Ii(ee,ke,Ze,Ut,or,Gn){var _r=Ze&i,Lr=ee.length,kr=ke.length;if(Lr!=kr&&!(_r&&kr>Lr))return!1;var Vr=Gn.get(ee);if(Vr&&Gn.get(ke))return Vr==ke;var Zr=-1,Di=!0,ji=Ze&a?new zt:void 0;for(Gn.set(ee,ke),Gn.set(ke,ee);++Zr<Lr;){var Kr=ee[Zr],Si=ke[Zr];if(Ut)var ya=_r?Ut(Si,Kr,Zr,ke,ee,Gn):Ut(Kr,Si,Zr,ee,ke,Gn);if(ya!==void 0){if(ya)continue;Di=!1;break}if(ji){if(!ge(ke,function(La,hs){if(!Ne(ji,hs)&&(Kr===La||or(Kr,La,Ze,Ut,Gn)))return ji.push(hs)})){Di=!1;break}}else if(!(Kr===Si||or(Kr,Si,Ze,Ut,Gn))){Di=!1;break}}return Gn.delete(ee),Gn.delete(ke),Di}function Da(ee,ke,Ze,Ut,or,Gn,_r){switch(Ze){case z:if(ee.byteLength!=ke.byteLength||ee.byteOffset!=ke.byteOffset)return!1;ee=ee.buffer,ke=ke.buffer;case M:return!(ee.byteLength!=ke.byteLength||!Gn(new Ot(ee),new Ot(ke)));case d:case f:case A:return br(+ee,+ke);case h:return ee.name==ke.name&&ee.message==ke.message;case C:case T:return ee==ke+"";case v:var Lr=V;case _:var kr=Ut&i;if(Lr||(Lr=X),ee.size!=ke.size&&!kr)return!1;var Vr=_r.get(ee);if(Vr)return Vr==ke;Ut|=a,_r.set(ee,ke);var Zr=Ii(Lr(ee),Lr(ke),Ut,or,Gn,_r);return _r.delete(ee),Zr;case O:if(Zn)return Zn.call(ee)==Zn.call(ke)}return!1}function _i(ee,ke,Ze,Ut,or,Gn){var _r=Ze&i,Lr=qi(ee),kr=Lr.length,Vr=qi(ke),Zr=Vr.length;if(kr!=Zr&&!_r)return!1;for(var Di=kr;Di--;){var ji=Lr[Di];if(!(_r?ji in ke:ct.call(ke,ji)))return!1}var Kr=Gn.get(ee);if(Kr&&Gn.get(ke))return Kr==ke;var Si=!0;Gn.set(ee,ke),Gn.set(ke,ee);for(var ya=_r;++Di<kr;){ji=Lr[Di];var La=ee[ji],hs=ke[ji];if(Ut)var ps=_r?Ut(hs,La,ji,ke,ee,Gn):Ut(La,hs,ji,ee,ke,Gn);if(!(ps===void 0?La===hs||or(La,hs,Ze,Ut,Gn):ps)){Si=!1;break}ya||(ya=ji=="constructor")}if(Si&&!ya){var qa=ee.constructor,ci=ke.constructor;qa!=ci&&"constructor"in ee&&"constructor"in ke&&!(typeof qa=="function"&&qa instanceof qa&&typeof ci=="function"&&ci instanceof ci)&&(Si=!1)}return Gn.delete(ee),Gn.delete(ke),Si}function qi(ee){return In(ee,po,Nn)}function Zt(ee,ke){var Ze=ee.__data__;return an(ke)?Ze[typeof ke=="string"?"string":"hash"]:Ze.map}function Ue(ee,ke){var Ze=me(ee,ke);return gi(Ze)?Ze:void 0}function Xt(ee){var ke=ct.call(ee,Kt),Ze=ee[Kt];try{ee[Kt]=void 0;var Ut=!0}catch{}var or=nt.call(ee);return Ut&&(ke?ee[Kt]=Ze:delete ee[Kt]),or}var Nn=An?function(ee){return ee==null?[]:(ee=Object(ee),he(An(ee),function(ke){return $e.call(ee,ke)}))}:yi,ar=Fr;(On&&ar(new On(new ArrayBuffer(1)))!=z||Jn&&ar(new Jn)!=v||Cn&&ar(Cn.resolve())!=S||jt&&ar(new jt)!=_||st&&ar(new st)!=B)&&(ar=function(ee){var ke=Fr(ee),Ze=ke==x?ee.constructor:void 0,Ut=Ze?Dn(Ze):"";if(Ut)switch(Ut){case dt:return z;case Ht:return v;case Tn:return S;case kn:return _;case Rn:return B}return ke});function Jr(ee,ke){return ke=ke??s,!!ke&&(typeof ee=="number"||Q.test(ee))&&ee>-1&&ee%1==0&&ee<ke}function an(ee){var ke=typeof ee;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?ee!=="__proto__":ee===null}function Ye(ee){return!!Dt&&Dt in ee}function Tt(ee){var ke=ee&&ee.constructor,Ze=typeof ke=="function"&&ke.prototype||Se;return ee===Ze}function on(ee){return nt.call(ee)}function Dn(ee){if(ee!=null){try{return je.call(ee)}catch{}try{return ee+""}catch{}}return""}function br(ee,ke){return ee===ke||ee!==ee&&ke!==ke}var Yr=Kn(function(){return arguments}())?Kn:function(ee){return Ls(ee)&&ct.call(ee,"callee")&&!$e.call(ee,"callee")},ii=Array.isArray;function Ua(ee){return ee!=null&&Cs(ee.length)&&!xs(ee)}var fs=yn||Ai;function Il(ee,ke){return ur(ee,ke)}function xs(ee){if(!Ms(ee))return!1;var ke=Fr(ee);return ke==m||ke==g||ke==u||ke==E}function Cs(ee){return typeof ee=="number"&&ee>-1&&ee%1==0&&ee<=s}function Ms(ee){var ke=typeof ee;return ee!=null&&(ke=="object"||ke=="function")}function Ls(ee){return ee!=null&&typeof ee=="object"}var _l=K?Le(K):li;function po(ee){return Ua(ee)?Tr(ee):ri(ee)}function yi(){return[]}function Ai(){return!1}t.exports=Il}(B5,B5.exports);var U$=B5.exports,PS={};Object.defineProperty(PS,"__esModule",{value:!0});const TTe=V$,ETe=U$;var MS;(function(t){function e(a={},s={},l=!1){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let c=TTe(s);l||(c=Object.keys(c).reduce((u,d)=>(c[d]!=null&&(u[d]=c[d]),u),{}));for(const u in a)a[u]!==void 0&&s[u]===void 0&&(c[u]=a[u]);return Object.keys(c).length>0?c:void 0}t.compose=e;function n(a={},s={}){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});const l=Object.keys(a).concat(Object.keys(s)).reduce((c,u)=>(ETe(a[u],s[u])||(c[u]=s[u]===void 0?null:s[u]),c),{});return Object.keys(l).length>0?l:void 0}t.diff=n;function r(a={},s={}){a=a||{};const l=Object.keys(s).reduce((c,u)=>(s[u]!==a[u]&&a[u]!==void 0&&(c[u]=s[u]),c),{});return Object.keys(a).reduce((c,u)=>(a[u]!==s[u]&&s[u]===void 0&&(c[u]=null),c),l)}t.invert=r;function i(a,s,l=!1){if(typeof a!="object")return s;if(typeof s!="object")return;if(!l)return s;const c=Object.keys(s).reduce((u,d)=>(a[d]===void 0&&(u[d]=s[d]),u),{});return Object.keys(c).length>0?c:void 0}t.transform=i})(MS||(MS={})),PS.default=MS;var V5={};Object.defineProperty(V5,"__esModule",{value:!0});var LS;(function(t){function e(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}t.length=e})(LS||(LS={})),V5.default=LS;var BS={};Object.defineProperty(BS,"__esModule",{value:!0});const q$=V5;class ITe{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const n=this.ops[this.index];if(n){const r=this.offset,i=q$.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete=="number")return{delete:e};{const a={};return n.attributes&&(a.attributes=n.attributes),typeof n.retain=="number"?a.retain=e:typeof n.retain=="object"&&n.retain!==null?a.retain=n.retain:typeof n.insert=="string"?a.insert=n.insert.substr(r,e):a.insert=n.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?q$.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const e=this.offset,n=this.index,r=this.next(),i=this.ops.slice(this.index);return this.offset=e,this.index=n,[r].concat(i)}}else return[]}}BS.default=ITe,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=CTe,r=V$,i=U$,a=PS;e.AttributeMap=a.default;const s=V5;e.Op=s.default;const l=BS;e.OpIterator=l.default;const c="\0",u=(f,h)=>{if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const m=Object.keys(f)[0];if(!m||m!==Object.keys(h)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(h)[0]}`);return[m,f[m],h[m]]};class d{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,m){this.handlers[h]=m}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const m=this.handlers[h];if(!m)throw new Error(`no handlers for embed type "${h}"`);return m}insert(h,m){const g={};return typeof h=="string"&&h.length===0?this:(g.insert=h,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(g.attributes=m),this.push(g))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,m){if(typeof h=="number"&&h<=0)return this;const g={retain:h};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(g.attributes=m),this.push(g)}push(h){let m=this.ops.length,g=this.ops[m-1];if(h=r(h),typeof g=="object"){if(typeof h.delete=="number"&&typeof g.delete=="number")return this.ops[m-1]={delete:g.delete+h.delete},this;if(typeof g.delete=="number"&&h.insert!=null&&(m-=1,g=this.ops[m-1],typeof g!="object"))return this.ops.unshift(h),this;if(i(h.attributes,g.attributes)){if(typeof h.insert=="string"&&typeof g.insert=="string")return this.ops[m-1]={insert:g.insert+h.insert},typeof h.attributes=="object"&&(this.ops[m-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof g.retain=="number")return this.ops[m-1]={retain:g.retain+h.retain},typeof h.attributes=="object"&&(this.ops[m-1].attributes=h.attributes),this}}return m===this.ops.length?this.ops.push(h):this.ops.splice(m,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const m=[],g=[];return this.forEach(v=>{(h(v)?m:g).push(v)}),[m,g]}reduce(h,m){return this.ops.reduce(h,m)}changeLength(){return this.reduce((h,m)=>m.insert?h+s.default.length(m):m.delete?h-m.delete:h,0)}length(){return this.reduce((h,m)=>h+s.default.length(m),0)}slice(h=0,m=1/0){const g=[],v=new l.default(this.ops);let A=0;for(;A<m&&v.hasNext();){let w;A<h?w=v.next(h-A):(w=v.next(m-A),g.push(w)),A+=s.default.length(w)}return new d(g)}compose(h){const m=new l.default(this.ops),g=new l.default(h.ops),v=[],A=g.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let x=A.retain;for(;m.peekType()==="insert"&&m.peekLength()<=x;)x-=m.peekLength(),v.push(m.next());A.retain-x>0&&g.next(A.retain-x)}const w=new d(v);for(;m.hasNext()||g.hasNext();)if(g.peekType()==="insert")w.push(g.next());else if(m.peekType()==="delete")w.push(m.next());else{const x=Math.min(m.peekLength(),g.peekLength()),S=m.next(x),E=g.next(x);if(E.retain){const C={};if(typeof S.retain=="number")C.retain=typeof E.retain=="number"?x:E.retain;else if(typeof E.retain=="number")S.retain==null?C.insert=S.insert:C.retain=S.retain;else{const T=S.retain==null?"insert":"retain",[O,F,B]=u(S[T],E.retain),M=d.getHandler(O);C[T]={[O]:M.compose(F,B,T==="retain")}}const _=a.default.compose(S.attributes,E.attributes,typeof S.retain=="number");if(_&&(C.attributes=_),w.push(C),!g.hasNext()&&i(w.ops[w.ops.length-1],C)){const T=new d(m.rest());return w.concat(T).chop()}}else typeof E.delete=="number"&&(typeof S.retain=="number"||typeof S.retain=="object"&&S.retain!==null)&&w.push(E)}return w.chop()}concat(h){const m=new d(this.ops.slice());return h.ops.length>0&&(m.push(h.ops[0]),m.ops=m.ops.concat(h.ops.slice(1))),m}diff(h,m){if(this.ops===h.ops)return new d;const g=[this,h].map(S=>S.map(E=>{if(E.insert!=null)return typeof E.insert=="string"?E.insert:c;const C=S===h?"on":"with";throw new Error("diff() called "+C+" non-document")}).join("")),v=new d,A=n(g[0],g[1],m,!0),w=new l.default(this.ops),x=new l.default(h.ops);return A.forEach(S=>{let E=S[1].length;for(;E>0;){let C=0;switch(S[0]){case n.INSERT:C=Math.min(x.peekLength(),E),v.push(x.next(C));break;case n.DELETE:C=Math.min(E,w.peekLength()),w.next(C),v.delete(C);break;case n.EQUAL:C=Math.min(w.peekLength(),x.peekLength(),E);const _=w.next(C),T=x.next(C);i(_.insert,T.insert)?v.retain(C,a.default.diff(_.attributes,T.attributes)):v.push(T).delete(C);break}E-=C}}),v.chop()}eachLine(h,m=`
|
|
4175
4175
|
`){const g=new l.default(this.ops);let v=new d,A=0;for(;g.hasNext();){if(g.peekType()!=="insert")return;const w=g.peek(),x=s.default.length(w)-g.peekLength(),S=typeof w.insert=="string"?w.insert.indexOf(m,x)-x:-1;if(S<0)v.push(g.next());else if(S>0)v.push(g.next(S));else{if(h(v,g.next(1).attributes||{},A)===!1)return;A+=1,v=new d}}v.length()>0&&h(v,{},A)}invert(h){const m=new d;return this.reduce((g,v)=>{if(v.insert)m.delete(s.default.length(v));else{if(typeof v.retain=="number"&&v.attributes==null)return m.retain(v.retain),g+v.retain;if(v.delete||typeof v.retain=="number"){const A=v.delete||v.retain;return h.slice(g,g+A).forEach(x=>{v.delete?m.push(x):v.retain&&v.attributes&&m.retain(s.default.length(x),a.default.invert(v.attributes,x.attributes))}),g+A}else if(typeof v.retain=="object"&&v.retain!==null){const A=h.slice(g,g+1),w=new l.default(A.ops).next(),[x,S,E]=u(v.retain,w.insert),C=d.getHandler(x);return m.retain({[x]:C.invert(S,E)},a.default.invert(v.attributes,w.attributes)),g+1}}return g},0),m.chop()}transform(h,m=!1){if(m=!!m,typeof h=="number")return this.transformPosition(h,m);const g=h,v=new l.default(this.ops),A=new l.default(g.ops),w=new d;for(;v.hasNext()||A.hasNext();)if(v.peekType()==="insert"&&(m||A.peekType()!=="insert"))w.retain(s.default.length(v.next()));else if(A.peekType()==="insert")w.push(A.next());else{const x=Math.min(v.peekLength(),A.peekLength()),S=v.next(x),E=A.next(x);if(S.delete)continue;if(E.delete)w.push(E);else{const C=S.retain,_=E.retain;let T=typeof _=="object"&&_!==null?_:x;if(typeof C=="object"&&C!==null&&typeof _=="object"&&_!==null){const O=Object.keys(C)[0];if(O===Object.keys(_)[0]){const F=d.getHandler(O);F&&(T={[O]:F.transform(C[O],_[O],m)})}}w.retain(T,a.default.transform(S.attributes,E.attributes,m))}}return w.chop()}transformPosition(h,m=!1){m=!!m;const g=new l.default(this.ops);let v=0;for(;g.hasNext()&&v<=h;){const A=g.peekLength(),w=g.peekType();if(g.next(),w==="delete"){h-=Math.min(A,h-v);continue}else w==="insert"&&(v<h||!m)&&(h+=A);v+=A}return h}}d.Op=s.default,d.OpIterator=l.default,d.AttributeMap=a.default,d.handlers={},e.default=d,t.exports=d,t.exports.default=d}(OS,OS.exports);var ec=OS.exports;const rr=ms(ec);class zc extends Cl{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}zc.blotName="break",zc.tagName="BR";let Yc=class extends k5{};function U5(t){return t.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}const ku=class ku extends ES{static compare(e,n){const r=ku.order.indexOf(e),i=ku.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e<n?-1:1}formatAt(e,n,r,i){if(ku.compare(this.statics.blotName,r)<0&&this.scroll.query(r,ir.BLOT)){const a=this.isolate(e,n);i&&a.wrap(r,i)}else super.formatAt(e,n,r,i)}optimize(e){if(super.optimize(e),this.parent instanceof ku&&ku.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};Un(ku,"allowedChildren",[ku,zc,Cl,Yc]),Un(ku,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Nu=ku;const j$=1;class Xs extends Fg{constructor(){super(...arguments);Un(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=$$(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,i,a){r<=0||(this.scroll.query(i,ir.BLOCK)?n+r===this.length()&&this.format(i,a):super.formatAt(n,Math.min(r,this.length()-n-1),i,a),this.cache={})}insertAt(n,r,i){if(i!=null){super.insertAt(n,r,i),this.cache={};return}if(r.length===0)return;const a=r.split(`
|
|
4176
4176
|
`),s=a.shift();s.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),s):this.children.tail.insertAt(this.children.tail.length(),s),this.cache={});let l=this;a.reduce((c,u)=>(l=l.split(c,!0),l.insertAt(0,u),u.length),n+s.length)}insertBefore(n,r){const{head:i}=this.children;super.insertBefore(n,r),i instanceof zc&&i.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+j$),this.cache.length}moveChildren(n,r){super.moveChildren(n,r),this.cache={}}optimize(n){super.optimize(n),this.cache={}}path(n){return super.path(n,!0)}removeChild(n){super.removeChild(n),this.cache={}}split(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(n===0||n>=this.length()-j$)){const a=this.clone();return n===0?(this.parent.insertBefore(a,this),this):(this.parent.insertBefore(a,this.next),a)}const i=super.split(n,r);return this.cache={},i}}Xs.blotName="block",Xs.tagName="P",Xs.defaultChild=zc,Xs.allowedChildren=[zc,Nu,Cl,Yc];class tc extends Cl{attach(){super.attach(),this.attributes=new N5(this.domNode)}delta(){return new rr().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,ir.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,n)}formatAt(e,n,r,i){this.format(r,i)}insertAt(e,n,r){if(r!=null){super.insertAt(e,n,r);return}const i=n.split(`
|
|
4177
4177
|
`),a=i.pop(),s=i.map(c=>{const u=this.scroll.create(Xs.blotName);return u.insertAt(0,c),u}),l=this.split(e);s.forEach(c=>{this.parent.insertBefore(c,l)}),a&&this.parent.insertBefore(this.scroll.create("text",a),l)}}tc.scope=ir.BLOCK_BLOT;function $$(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(fo).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),nc(r,{},e)),new rr).insert(`
|
|
@@ -61931,7 +61931,7 @@ var che = function() {
|
|
|
61931
61931
|
theme: i.theme,
|
|
61932
61932
|
formats: i.formats
|
|
61933
61933
|
};
|
|
61934
|
-
che ? C(new Quill(d.current, M)) : import("./quill-
|
|
61934
|
+
che ? C(new Quill(d.current, M)) : import("./quill-DynXjXNG.js").then(function(z) {
|
|
61935
61935
|
if (z && Te.isExist(d.current)) {
|
|
61936
61936
|
var k;
|
|
61937
61937
|
z.default ? k = new z.default(d.current, M) : k = new z(d.current, M), C(k);
|
|
@@ -129523,7 +129523,7 @@ const MEe = () => /* @__PURE__ */ c(IEe, {}), REe = (t) => {
|
|
|
129523
129523
|
] });
|
|
129524
129524
|
}, LEe = () => {
|
|
129525
129525
|
const { renderType: t } = nn();
|
|
129526
|
-
return /* @__PURE__ */ c(Ie, { children: /* @__PURE__ */ I(Na, {
|
|
129526
|
+
return /* @__PURE__ */ c(Ie, { children: /* @__PURE__ */ I(Na, { children: [
|
|
129527
129527
|
t === rp && /* @__PURE__ */ c(rr, { header: "Survey", children: GJ.map((e, n) => /* @__PURE__ */ c(
|
|
129528
129528
|
Wr,
|
|
129529
129529
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ml = Object.defineProperty;
|
|
2
2
|
var Dl = (n, t, e) => t in n ? Ml(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var T = (n, t, e) => (Dl(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import { d as ti, i as Rr, a as Hi, b as Ul, e as Br, M as Pl, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as jl, n as Hl, o as Fi, p as $l, q as Fl, r as zl, s as Kl, t as ii, u as Gl, v as Vl, w as Ft, x as zi, y as xe } from "./main-
|
|
4
|
+
import { d as ti, i as Rr, a as Hi, b as Ul, e as Br, M as Pl, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as jl, n as Hl, o as Fi, p as $l, q as Fl, r as zl, s as Kl, t as ii, u as Gl, v as Vl, w as Ft, x as zi, y as xe } from "./main-CLDAuKU9.js";
|
|
5
5
|
function Ki(n) {
|
|
6
6
|
return n;
|
|
7
7
|
}
|