@lax-wp/design-system 0.11.13 → 0.11.14

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/index.cjs.js CHANGED
@@ -117,7 +117,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
117
117
  `).map(te=>te.trimEnd()).join(`
118
118
  `),K=K.replace(/\n+$/,"")+`
119
119
  `),navigator?.clipboard?.writeText(K).catch(te=>{const Ae=te;Ot.toast.error(Ae?.message||Lt.copyFailure("Python Code"),{toastId:Lt.copyFailure("Python Code")})})}catch(K){const te=K;Ot.toast.error(te?.message||Lt.copyFailure("Python Code"),{toastId:Lt.copyFailure("Python Code")})}else if(s==="json")try{const K=JSON.parse(t),te=JSON.stringify(K,null,4);navigator?.clipboard?.writeText(te)}catch(K){const te=K;Ot.toast.error(te?.message||Lt.copyFailure("JSON Code"),{toastId:Lt.copyFailure("JSON Code")})}else navigator?.clipboard?.writeText(t)},Ne=()=>{try{const K=new Blob([t],{type:J(s)?.type}),te=URL.createObjectURL(K),Ae=document.createElement("a");Ae.href=te;const xe=J(s)?.extension||"txt",De=oe(xe,"txt");Ae.download=oe(`code_${Date.now()}.${De}`,`code_${Date.now()}.${De}`),document.body.appendChild(Ae),Ae.click(),document.body.removeChild(Ae),URL.revokeObjectURL(te)}catch(K){const te=K;Ot.toast.error(te?.message||Lt.copyFailure("Code download"),{toastId:Lt.copyFailure("Code download")})}},be=B("hover:bg-neutral-300 hover:dark:bg-neutral-700 p-0.5 rounded-md flex items-center justify-center");return A.jsx(Wl.FullScreen,{handle:U,className:"h-full",children:A.jsxs("div",{className:ts.cn("relative border border-neutral-200 dark:border-neutral-700 rounded-lg h-full overflow-hidden",d),id:"code-editor-beta-container",children:[A.jsxs("div",{className:B(`px-3 py-2 flex items-center bg-white dark:bg-neutral-800 ${u?"border-none":"border-b border-neutral-200 dark:border-neutral-700"}`,P?"justify-between":"justify-end"),children:[P&&u?A.jsx(Qn,{isChecked:C==="Grid",onChange:K=>_(K?"Grid":"JSON"),hideStatus:!0,withIcon:!0,size:"small",tooltip:C==="JSON"?"Grid view":"Code view",icon:{checkedIcon:A.jsx(ZB,{fontSize:14}),uncheckedIcon:A.jsx(KB,{fontSize:14})},stopClickPropagation:!1}):null,A.jsxs("div",{className:"flex items-center gap-0.5",children:[y?.({editorRef:S.current,value:t,onChange:e,language:s,isEditMode:a,activeTab:C}),C==="Grid"&&a&&u?A.jsx("span",{className:"flex items-center justify-center border-r border-neutral-200 dark:border-neutral-700 mr-1.5 pr-1.5",children:A.jsx(Le,{title:"Add key",children:A.jsx("button",{id:"btn-code-editor-beta-json-grid-add",onClick:()=>R(!0),className:B("p-0.5 rounded-md flex items-center justify-center","hover:bg-blue-100 hover:dark:bg-neutral-800 text-blue-600 dark:text-neutral-100"),children:A.jsx($B,{fontSize:16})})})}):null,C==="Grid"?A.jsxs(A.Fragment,{children:[A.jsx(Le,{title:"Collapse all",children:A.jsx("button",{id:"btn-code-editor-beta-json-grid-up",onClick:()=>O(!1),className:be,children:A.jsx(aq,{fontSize:16})})}),A.jsx(Le,{title:"Expand all",children:A.jsx("button",{id:"btn-code-editor-beta-json-grid-down",onClick:()=>O(!0),className:be,children:A.jsx(nq,{fontSize:16})})})]}):null,C==="JSON"&&u||s==="python"?A.jsx(Le,{title:W?"Formatting...":"Format",children:A.jsx("button",{id:"btn-code-editor-beta-format-code",onClick:ee,disabled:W,className:B(be,W&&"opacity-60"),children:A.jsx(sq,{fontSize:14})})}):null,n&&C==="JSON"&&u?A.jsx(Le,{title:T==="light"?"Dark mode":"Light mode",children:A.jsx("button",{id:"btn-code-editor-beta-with-theme",onClick:()=>c?void 0:k(T==="light"?"dark":"light"),className:be,children:T==="light"?A.jsx(eq,{fontSize:14}):A.jsx(iq,{fontSize:14})})}):null,(s==="python"||s==="json")&&o?A.jsx(Le,{title:"Copy",children:A.jsx("button",{id:"btn-code-editor-beta-copy-code",onClick:ae,className:be,children:A.jsx(JB,{fontSize:14})})}):null,(s==="python"||s==="json")&&l?A.jsx(Le,{title:"Download",children:A.jsx("button",{id:"btn-code-editor-beta-download-code",onClick:Ne,className:be,children:A.jsx(tq,{fontSize:14})})}):null,r?A.jsx(Le,{title:"Fullscreen",children:A.jsx("button",{onClick:I,id:"btn-code-editor-beta-fullscreen",className:be,children:A.jsx(rq,{fontSize:14})})}):null]})]}),C==="Grid"&&s==="json"?A.jsx("div",{children:A.jsx(Zu,{isFullScreen:U?.active,allExpanded:w,toggleAll:()=>O(K=>!K),isEditMode:!!a,isDarkMode:T==="dark",style:{height:U?.active?"100vh":i},value:t,onChange:e,setIsAddKeyModalOpen:R,isAddKeyModalOpen:N})}):A.jsx(lw,{ref:S,value:t,height:U?.active?"100vh":i,theme:T==="dark"?"dark":"light",extensions:re,editable:a,readOnly:!a,onChange:$,onCreateEditor:Q,basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:a,highlightSelectionMatches:!0,bracketMatching:!0,closeBrackets:a,autocompletion:a,indentOnInput:a,syntaxHighlighting:!0},style:{fontSize:14,fontFamily:"Menlo, Monaco, 'Courier New', monospace"}})]})})};vw.displayName="CodeEditorBeta";const lq=({variant:t="default",tabs:e,activeTab:r,onTabClick:n,size:a="md",tabIcons:i={},height:s="h-6",className:o})=>t==="switch"?A.jsx("div",{className:B("inline",o),children:A.jsx("ul",{className:"inline-flex grow-0 p-1 rounded-lg bg-neutral-100 dark:bg-neutral-700 w-auto",children:e.map(l=>{const u=r===l,c=i?.[l];return A.jsx("li",{className:"inline-flex w-auto",children:A.jsxs("button",{type:"button",onClick:()=>n(l),className:B("relative py-0.5 px-3 border-gray-200",s,"w-auto flex items-center justify-center","relative text-xs font-semibold font-sans whitespace-nowrap",u?"text-neutral-900 dark:text-neutral-100":"text-neutral-700 dark:text-neutral-100"),children:[u&&A.jsx("span",{className:"absolute inset-0 bg-white dark:bg-neutral-800 rounded-md z-0"}),A.jsxs("span",{className:"relative z-10 flex items-center gap-1",children:[c,l]})]})},l)})})}):A.jsx("div",{className:B("w-full",o),children:A.jsx("ul",{className:B("flex items-center w-full",a==="sm"?"gap-1":"gap-2"),children:e.map(l=>{const u=r===l,c=i?.[l];return A.jsx("li",{className:"sm:mr-2",children:A.jsxs("button",{type:"button",onClick:()=>n(l),className:B("relative inline-flex pt-1 pb-3 px-2 pl-3 sm:px-2 rounded-t-lg group","relative uppercase font-sans font-semibold text-sm whitespace-nowrap",u?"text-blue-600 dark:text-blue-500":"text-neutral-400 hover:text-neutral-500 dark:text-neutral-100 dark:hover:text-white"),children:[A.jsxs("span",{className:"flex items-center gap-1",children:[c,l]}),u&&A.jsx("span",{className:"absolute left-0 bottom-0 w-full h-[3px] bg-blue-600"})]})},l)})})}),Sw=()=>{const[t,e]=h.useState("light"),[r,n]=h.useState("vs"),a=h.useCallback(i=>{n(i),e(i==="vs-dark"?"dark":"light")},[]);return{theme:t,editorTheme:r,setEditorTheme:a}},Ew=({className:t,size:e=26})=>A.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 17 26",fill:"none",children:A.jsx("path",{d:"M16.391 21.56C16.3099 22.4852 15.9426 23.0065 15.5742 23.2995C15.0359 23.7274 14.279 23.7081 13.7516 23.2665C12.576 22.2823 11.8296 19.7923 11.6614 19.1309C11.6576 19.1158 11.6545 19.102 11.6514 19.0888C11.647 19.0705 11.6425 19.0529 11.6382 19.0346C11.6338 19.017 11.6301 18.9993 11.6257 18.9817C11.6226 18.9698 11.6201 18.9572 11.6175 18.9453L11.6169 18.9447C10.7862 15.4591 10.038 11.9535 9.19849 8.47039C8.80328 6.83134 7.88558 3.7089 7.535 2.52765C7.34951 1.90269 7.02007 1.32691 6.55686 0.867931C6.23628 0.55043 5.82141 0.254489 5.30765 0.106076C5.30573 0.104747 5.30322 0.104156 5.30071 0.104156L5.30012 0.103565C5.26819 0.0952957 5.23567 0.0873212 5.20271 0.0799375C3.917 -0.21305 2.58872 0.317547 1.79962 1.37342C1.35976 1.9622 1.14516 2.5529 1.0646 2.81532C1.01864 2.97274 0.977994 3.13208 0.942374 3.29349C0.777429 4.04043 0.716831 4.8271 0.689192 5.62558H1.20295C1.20295 5.62558 1.54702 4.31422 1.81779 3.75025C2.64577 2.02452 4.79153 1.83077 5.9296 3.36113C6.21929 3.74937 6.48695 4.18545 6.63564 4.64177C7.04948 5.9097 7.41159 7.19595 7.7536 8.48471C7.81789 8.72705 7.76557 9.04854 7.65664 9.28319C5.4089 14.2092 2.24523 21.0746 0 26H3.44507C3.44507 26 7.11126 17.6438 8.91871 13.5201C9.56238 16.1789 10.0637 18.8224 10.7408 21.4673C10.9505 22.2999 11.2137 23.1342 11.5476 23.9309C11.5476 23.9309 11.5482 23.9334 11.5501 23.9379C11.5507 23.9398 11.5521 23.9429 11.5532 23.946C11.5753 24.007 11.666 24.2462 11.8253 24.5507C12.19 25.2486 12.9155 26 13.9995 26C16.5943 26 16.9508 21.5599 16.9508 21.5599H16.391V21.56Z",fill:"#016DCF"})}),Tw=({className:t,fill:e="currentColor",size:r=140})=>A.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg",fill:e,children:A.jsx("path",{d:"M82.2673 90.5993C81.9118 90.5993 81.5784 90.5438 81.2673 90.4327C80.9562 90.3216 80.6673 90.1327 80.4007 89.866L66.8007 76.266C66.534 75.9994 66.3451 75.7105 66.234 75.3994C66.1229 75.0882 66.0673 74.7549 66.0673 74.3994C66.0673 74.0438 66.1229 73.7105 66.234 73.3994C66.3451 73.0882 66.534 72.7994 66.8007 72.5327L72.4673 66.866C72.734 66.5993 73.0229 66.4105 73.334 66.2994C73.6451 66.1882 73.9784 66.1327 74.334 66.1327C74.6895 66.1327 75.0229 66.1882 75.334 66.2994C75.6451 66.4105 75.934 66.5993 76.2007 66.866L89.8007 80.466C90.0673 80.7327 90.2562 81.0216 90.3673 81.3327C90.4784 81.6438 90.534 81.9771 90.534 82.3327C90.534 82.6882 90.4784 83.0216 90.3673 83.3327C90.2562 83.6438 90.0673 83.9327 89.8007 84.1994L84.134 89.866C83.8673 90.1327 83.5784 90.3216 83.2673 90.4327C82.9562 90.5438 82.6229 90.5993 82.2673 90.5993ZM82.2673 84.266L84.2007 82.3327L74.4007 72.5327L72.4673 74.466L82.2673 84.266ZM45.6673 90.666C45.3118 90.666 44.9673 90.5994 44.634 90.466C44.3007 90.3327 44.0007 90.1327 43.734 89.866L38.134 84.266C37.8673 83.9994 37.6673 83.6994 37.534 83.366C37.4007 83.0327 37.334 82.6882 37.334 82.3327C37.334 81.9771 37.4007 81.6438 37.534 81.3327C37.6673 81.0216 37.8673 80.7327 38.134 80.466L52.2673 66.3327H57.934L60.2007 64.066L49.2007 53.066H45.4007L37.334 44.9993L44.8673 37.466L52.934 45.5327V49.3327L63.934 60.3327L71.6673 52.5993L68.8007 49.7327L72.534 45.9993H65.0007L63.134 44.1327L72.6007 34.666L74.4673 36.5327V44.066L78.2007 40.3327L87.6673 49.7993C88.4229 50.5549 89.0007 51.4105 89.4007 52.366C89.8007 53.3216 90.0007 54.3327 90.0007 55.3993C90.0007 56.466 89.8007 57.4882 89.4007 58.466C89.0007 59.4438 88.4229 60.3105 87.6673 61.066L82.0007 55.3993L78.2673 59.1327L75.4673 56.3327L61.6673 70.1327V75.7327L47.534 89.866C47.2673 90.1327 46.9784 90.3327 46.6673 90.466C46.3562 90.5994 46.0229 90.666 45.6673 90.666ZM45.6673 84.266L57.0007 72.9327V70.9994H55.0673L43.734 82.3327L45.6673 84.266ZM45.6673 84.266L43.734 82.3327L44.734 83.266L45.6673 84.266Z"})}),uq=({className:t="",fill:e="currentColor",size:r=20})=>A.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("g",{mask:"url(#mask0_6752_28309)",children:A.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),cq=({title:t,visible:e,onClose:r,content:n})=>A.jsxs(un,{title:null,open:e,footer:null,onCancel:r,zIndex:9999,showCloseButton:!1,width:400,children:[A.jsxs("div",{children:[A.jsx("div",{className:"flex justify-center",children:A.jsx("div",{className:"flex w-[48px] h-[48px] justify-center items-center gap-2 rounded-lg border border-[#54A4EC] shadow-[0_0_4px_2px_rgba(198,225,249,0.20)_inset]",children:A.jsx(Ew,{})})}),A.jsx(ne,{size:"medium",variant:"semibold",className:"text-center mt-3",children:t}),A.jsx(ne,{size:"small",variant:"medium",className:"text-center text-neutral-500 mt-2 dark:text-neutral-400",appearance:"custom",children:n})]}),A.jsx("div",{className:"flex justify-center mt-4",children:A.jsx(ht,{id:"btn-access-denied-modal-close",appearance:"outline",status:"secondary-neutral",onClick:r,children:"Close"})})]}),dq=({containerClass:t})=>A.jsx("div",{className:B("flex justify-center items-center h-table",t),children:A.jsxs("div",{className:"flex flex-col items-center text-neutral-800 -mt-12",children:[A.jsx("div",{className:"-mb-4",children:A.jsx(Tw,{})}),A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"text-3xl font-bold font-inter",children:"Feature Coming Soon"}),A.jsx("div",{className:"py-2"}),A.jsx("p",{className:"font-inter text-sm",children:"We're in the process of crafting this page"})]})]})}),fq=({visible:t,onClose:e,onSaveAndExit:r,onDiscardChanges:n,onCancel:a,isLoading:i=!1,title:s="You have unsaved changes",content:o="Switching to view mode will discard any unsaved edits. What would you like to do?",cancelText:l="Cancel",discardText:u="Discard Changes",saveText:c="Save & Exit"})=>{const d=h.useMemo(()=>A.jsxs("div",{className:"flex justify-end gap-3",children:[A.jsx(ht,{id:"btn-unsaved-changes-modal-cancel",onClick:a,disabled:i,status:"secondary-neutral",children:l}),A.jsx(ht,{id:"btn-unsaved-changes-modal-discard",onClick:n,disabled:i,status:"error",children:u}),A.jsx(ht,{id:"btn-unsaved-changes-modal-save-exit",onClick:r,isLoading:i,status:"primary",children:c})]}),[a,n,r,i,l,u,c]);return t?A.jsx(un,{title:s,open:t,footer:d,onCancel:e,zIndex:9999,children:A.jsx("div",{className:"my-5",children:A.jsx("div",{className:"text-neutral-400 font-inter text-base",children:o})})}):null},pq=({visible:t,onClose:e,content:r="",title:n="Error",okText:a="OK"})=>{const i=()=>{e()},s=A.jsx("div",{className:"flex justify-end",children:A.jsx(ht,{id:"btn-error-modal-submit-ok",status:"primary",onClick:i,type:"submit",children:a})});return A.jsx(un,{asForm:!0,title:n,open:t,onCancel:i,footer:s,children:A.jsx("div",{className:"text-neutral-400 text-base font-inter",children:r})})},hq=({visible:t,onClose:e,onSuccessClose:r,sectionName:n,suffix:a,onAgreementDelete:i,from:s,text:o,additionalText:l,title:u,deleteConfirm:c,onDeleteConfirm:d,onConfirmDelete:f,isLoading:p=!1,isMod:m=!1,isBooleanButton:g=!1,cancelText:y="Cancel",deleteText:b="Delete",yesText:v="Yes",noText:S="No",removeText:E="Remove"})=>{const k=async O=>{if(O.preventDefault(),s==="integration"){f?.();return}if(s==="config"){i?.();return}if(s==="field"){c?.();return}if(s==="fieldConfig"){d?.();return}if(s==="masterdata"){d?.();return}if(s==="attachment"){d?.();return}if(s==="agreement"){d?.();return}if(s==="analytics"){d?.();return}if(s==="clause"){d?.();return}if(s==="role"){d?.();return}Ot.toast.success(Lt.deleteSuccess("Section"),{toastId:Lt.deleteSuccess("Section")}),r?.()},T=()=>{p||e()},w=A.jsxs("div",{className:"flex justify-end gap-2 sm:mt-0 mt-20",children:[A.jsx(ht,{id:`btn-delete-modal-${g?"no":"cancel"}`,appearance:"outline",status:"secondary-neutral",onClick:T,className:"mt-10",disabled:p,children:g?S:y}),A.jsx(ht,{id:`btn-delete-modal-${g?"yes":m?"remove":"delete"}`,status:"error",onClick:k,className:"mt-10",disabled:p,isLoading:p,type:"submit",children:g?v:m?E:b})]},"");return A.jsx(un,{asForm:!0,title:u,open:t,onCancel:T,footer:w,children:A.jsxs("div",{className:"mt-5 mb-8",children:[A.jsxs(ne,{variant:"regular",size:"medium",appearance:"body",className:"font-inter",children:[o,n&&A.jsxs("span",{className:"font-bold text-neutral-900 dark:text-neutral-100",children:[" ",n]}),a&&A.jsxs("span",{children:[" ",a]}),"?"]}),l&&A.jsx(ne,{variant:"regular",size:"medium",className:"text-neutral-700 font-inter mt-5",children:l})]})})},b2=h.forwardRef(({oldText:t,newText:e,diffType:r="words",theme:n="default",showLineNumbers:a=!1,wordWrap:i=!0,className:s,segmentClassName:o,addedClassName:l,removedClassName:u,unchangedClassName:c,ignoreCase:d=!1,ignoreWhitespace:f=!1,maxWidth:p,"aria-label":m,onDiffCalculated:g},y)=>{const b=h.useMemo(()=>{let O=[];switch(r){case"lines":O=Xc.diffLines(t,e,{ignoreWhitespace:f});break;case"chars":O=Xc.diffChars(t,e,{ignoreCase:d});break;case"words":default:O=Xc.diffWords(t,e,{ignoreCase:d});break}return g?.(O),O},[t,e,r,d,f,g]),v=()=>{switch(n){case"minimal":return{added:"bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-200",removed:"bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-200 line-through",unchanged:"text-neutral-700 dark:text-neutral-300"};case"github":return{added:"bg-green-50 dark:bg-green-900/20 text-green-900 dark:text-green-100 border-l-4 border-green-500 pl-2",removed:"bg-red-50 dark:bg-red-900/20 text-red-900 dark:text-red-100 border-l-4 border-red-500 pl-2 line-through",unchanged:"text-neutral-800 dark:text-neutral-200 pl-2"};case"default":default:return{added:"bg-success-100 dark:bg-success-900/70 text-success-800 dark:text-success-200 font-semibold rounded-sm px-1",removed:"bg-error-100 dark:bg-error-900 text-error-800 dark:text-error-200 font-semibold line-through rounded-sm px-1",unchanged:"text-neutral-700 dark:text-neutral-300"}}},S=()=>B("diff-viewer font-mono text-sm leading-relaxed",i?"whitespace-pre-wrap":"whitespace-pre overflow-x-auto",n==="github"&&"border border-neutral-200 dark:border-neutral-700 rounded-lg",n==="minimal"&&"border-l-2 border-neutral-200 dark:border-neutral-600 pl-4"),E=()=>{if(!a||r!=="lines")return null;let O=1;return A.jsxs("div",{className:"flex",children:[A.jsx("div",{className:"select-none text-neutral-400 dark:text-neutral-600 text-right pr-4 border-r border-neutral-200 dark:border-neutral-700",children:b.map((C,_)=>{if(!C.added&&!C.removed){const N=C.value.split(`
120
- `).length-1,R=Array.from({length:N},(D,L)=>O+L);return O+=N,R.map((D,L)=>A.jsx("div",{className:"h-6",children:D},`${_}-${L}`))}return null})}),A.jsx("div",{className:"flex-1 pl-4",children:k()})]})},k=()=>{const O=v();return b.map((C,_)=>{let N="";return C.added?N=B(O.added,l,o):C.removed?N=B(O.removed,u,o):N=B(O.unchanged,c,o),A.jsx("span",{className:N,"data-diff-type":C.added?"added":C.removed?"removed":"unchanged",children:C.value},_)})},w=(()=>{const O=b.filter(N=>N.added).reduce((N,R)=>N+R.value.length,0),C=b.filter(N=>N.removed).reduce((N,R)=>N+R.value.length,0),_=b.filter(N=>!N.added&&!N.removed).reduce((N,R)=>N+R.value.length,0);return{added:O,removed:C,unchanged:_,total:O+C+_}})();return A.jsxs("div",{ref:y,className:B(S(),s),style:{maxWidth:p},"aria-label":m||`Text diff: ${w.added} additions, ${w.removed} deletions`,role:"region","aria-live":"polite",children:[A.jsxs("div",{className:"sr-only",children:["Diff statistics: ",w.added," characters added, ",w.removed," ","characters removed, ",w.unchanged," characters unchanged."]}),a&&r==="lines"?E():k()]})});b2.displayName="DiffViewer";const mq=b2,gq=({icon:t,title:e,description:r,variant:n,className:a,onClick:i,id:s})=>A.jsxs("div",{className:`w-full p-4 rounded-lg border ${n=="primary"?"bg-primary-50 border-primary-100 dark:bg-black-700 dark:border-black-600":"bg-neutral-50 border-neutral-200 dark:bg-black-700 dark:border-black-600"} justify-start items-start gap-2 inline-flex ${a||""}`,onClick:i,id:s,children:[t?A.jsx("div",{className:"w-10 h-10 justify-center items-center gap-2 flex",children:t}):null,A.jsxs("div",{className:"grow shrink basis-0 flex-col justify-start items-start gap-0.5 inline-flex",children:[A.jsx("div",{className:`${n=="primary"?"text-primary-600":"text-neutral-600"} text-sm font-medium`,children:e||""}),r?A.jsx("div",{className:`self-stretch ${n=="primary"?"text-primary-500":"text-neutral-400"} text-xs font-medium`,children:r}):null]})]}),kw=({className:t,isChecked:e,onSelect:r})=>A.jsx("input",{type:"radio",className:t,id:"connection",checked:e,onClick:r}),zg=({className:t,disabled:e,...r})=>A.jsx("button",{id:"btn-three-dots",className:"relative w-10 flex justify-center",...r,children:A.jsx(In.BsThreeDotsVertical,{size:18,className:`text-neutral-500 dark:text-black-200 hover:text-neutral-700 dark:hover:text-neutral-400 ${e?"opacity-50":""} ${t||""}`})}),ww=({children:t,variant:e})=>A.jsx("div",{className:`inline-flex ${e==="group"?"border border-neutral-300 divide-x rounded-lg":"gap-2"}`,children:t}),Ow=(t,e)=>{h.useEffect(()=>()=>{},[t,e])},Cw=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,searchIndex:o,searchCount:l,isAnimated:u,onFocusText:c,autoComplete:d="off",searchRef:f,onSelectResult:p,isLoading:m,...g}=t,{t:y}=Vt.useTranslation(),[b,v]=h.useState(r?.slice(0,0)),[S,E]=h.useState(0),[k,T]=h.useState(!1),[w,O]=h.useState("search"),[C,_]=h.useState(!0),N=h.useRef(null);Ow(a,f||N);const R=l?(o||0)+1:0;h.useEffect(()=>{const U=setInterval(()=>{v(r?.slice(0,S)),S+1>(r?.length||0)?E(0):E(S+1)},100);return()=>{clearInterval(U)}});const D=()=>{n?.(""),_(!C)},L=()=>{T(!0),O(c||r||"Search")},P=()=>{T(!1),O("")};return A.jsx(A.Fragment,{children:A.jsx(ze.AnimatePresence,{children:C?A.jsx(ze.motion.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.1},children:A.jsx(ar,{onClick:D,tooltip:"Search",children:A.jsx(de.SearchRounded,{className:"text-neutral-400 dark:text-white",width:"16",height:"16"})})},"searchButton"):A.jsxs(ze.motion.label,{className:B("relative flex items-center justify-start px-4 py-[9px] mt-[1px] w-[25rem] bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-[40px] border border-primary-100 dark:border-primary-800 shadow",s),initial:{opacity:0,width:0},animate:{opacity:1,width:"25rem"},exit:{opacity:0,width:0},transition:{duration:.1},children:[A.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:A.jsx(de.SearchRounded,{className:"text-neutral-400 dark:text-white dark:bg-black-700",width:"16",height:"16"})}),A.jsx(db.DebounceInput,{...g,debounceTimeout:i,id:a,autoFocus:!0,inputRef:f||N,type:"text",className:B("absolute inset-0 pl-10 w-[280px] text-sm text-neutral-900 dark:text-white bg-transparent rounded-lg focus:outline-none",s),onKeyDown:U=>{U.key==="ArrowDown"||U.key==="Enter"?(U.preventDefault(),p?.(o+1)):U.key==="ArrowUp"&&(U.preventDefault(),p?.(o-1))},value:e||"",placeholder:k?w:u?b:r||`${y("search")}...`,onChange:U=>n?.(U.target.value),autoComplete:d,onFocus:L,onBlur:P}),m?A.jsx("div",{className:"flex absolute right-0 mr-2 focus:outline-none",children:A.jsx(K4.CircularProgress,{sx:{color:"var(--color-primary-600)"},className:"text-gray-400 dark:text-black-200",size:16})}):e?A.jsxs("div",{className:"flex absolute right-0 mr-2 focus:outline-none",children:[A.jsxs(ne,{size:"small",variant:"semibold",className:"text-gray-400 dark:text-black-200 mx-2 mt-[2px]",appearance:"custom",children:[R,"/",l||0]}),A.jsx("div",{className:"w-[1px] my-[3px] bg-gray-300"}),A.jsx(de.KeyboardArrowUpRounded,{className:"cursor-pointer",onClick:()=>p?.(o-1)}),A.jsx(de.KeyboardArrowDownRounded,{className:"cursor-pointer",onClick:()=>p?.(o+1)}),A.jsx(Gl,{className:"right-0 mr-2 mt-[1px]",size:20,onClick:D})]}):A.jsx("div",{className:"flex absolute right-0 mr-2 focus:outline-none z-[52]",children:A.jsx(Gl,{classValue:"right-0 mb-[1px] mr-2 hover:cursor-pointer hover:text-neutral-700",size:20,onClick:D})})]},"searchBar")})})},x2=()=>{const{pathname:t}=qu.useLocation();h.useEffect(()=>{window.scrollTo(0,0)},[t])};var Ra=(t=>(t.COMPARISON="comparison",t.EDIT="edit",t.FOCUS_EDIT="focusEdit",t))(Ra||{});const y2=500,_w=({title:t,children:e,mode:r,displayId:n,noPadding:a=!1,className:i,noBanner:s=!1,contentClassName:o,onBannerClick:l,scrollToTopOnMount:u=!0})=>{x2();const c=h.useMemo(()=>r===Ra.EDIT||r===Ra.FOCUS_EDIT?"edit":r===Ra.COMPARISON?"compare":null,[r]),d=h.useMemo(()=>(c==="edit"&&n||c==="compare")&&!s,[c,n,s]),f=h.useMemo(()=>c==="edit"&&n?{status:"warning",message:`You're currently editing ${n}`}:c==="compare"?{status:"success",message:"You are now in Comparison Mode"}:null,[c,n]);return A.jsxs(A.Fragment,{children:[A.jsx(gs,{title:t}),A.jsxs("div",{className:ts.cn("relative h-[calc(100vh-56px)] overflow-y-auto flex flex-col bg-primary-800 dark:bg-black-800",`ease-in-out duration-${y2}`,i),children:[d&&f&&A.jsx(wo,{status:f.status,children:f.message}),A.jsx("div",{className:ts.cn("flex-1 overflow-y-auto overflow-x-hidden bg-gray-50 dark:bg-black-700",a?"p-0":"p-4",d?"rounded-tl-none":"!rounded-tl-xl",o),id:"app-body-container",children:e})]})]})};_w.displayName="PageContainer";const Nw=({title:t,meta:e,children:r})=>A.jsxs(zN.Helmet,{children:[A.jsx("title",{children:t}),e&&A.jsx("meta",{...e}),r]});Nw.displayName="Helmet";const Dw=({className:t,label:e})=>A.jsxs("div",{className:t,children:[A.jsx("div",{className:"font-bold text-xl mr-2",children:e}),A.jsx("div",{className:"mb-2 flex justify-center w-full",children:A.jsx("div",{className:"flex items-center justify-center",children:A.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600 dark:border-primary-400"})})})]});Dw.displayName="ComponentLoader";const bq=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"300",height:"200",viewBox:"0 0 300 200",children:[A.jsxs("defs",{children:[A.jsx("style",{children:`
120
+ `).length-1,R=Array.from({length:N},(D,L)=>O+L);return O+=N,R.map((D,L)=>A.jsx("div",{className:"h-6",children:D},`${_}-${L}`))}return null})}),A.jsx("div",{className:"flex-1 pl-4",children:k()})]})},k=()=>{const O=v();return b.map((C,_)=>{let N="";return C.added?N=B(O.added,l,o):C.removed?N=B(O.removed,u,o):N=B(O.unchanged,c,o),A.jsx("span",{className:N,"data-diff-type":C.added?"added":C.removed?"removed":"unchanged",children:C.value},_)})},w=(()=>{const O=b.filter(N=>N.added).reduce((N,R)=>N+R.value.length,0),C=b.filter(N=>N.removed).reduce((N,R)=>N+R.value.length,0),_=b.filter(N=>!N.added&&!N.removed).reduce((N,R)=>N+R.value.length,0);return{added:O,removed:C,unchanged:_,total:O+C+_}})();return A.jsxs("div",{ref:y,className:B(S(),s),style:{maxWidth:p},"aria-label":m||`Text diff: ${w.added} additions, ${w.removed} deletions`,role:"region","aria-live":"polite",children:[A.jsxs("div",{className:"sr-only",children:["Diff statistics: ",w.added," characters added, ",w.removed," ","characters removed, ",w.unchanged," characters unchanged."]}),a&&r==="lines"?E():k()]})});b2.displayName="DiffViewer";const mq=b2,gq=({icon:t,title:e,description:r,variant:n,className:a,onClick:i,id:s})=>A.jsxs("div",{className:`w-full p-4 rounded-lg border ${n=="primary"?"bg-primary-50 border-primary-100 dark:bg-black-700 dark:border-black-600":"bg-neutral-50 border-neutral-200 dark:bg-black-700 dark:border-black-600"} justify-start items-start gap-2 inline-flex ${a||""}`,onClick:i,id:s,children:[t?A.jsx("div",{className:"w-10 h-10 justify-center items-center gap-2 flex",children:t}):null,A.jsxs("div",{className:"grow shrink basis-0 flex-col justify-start items-start gap-0.5 inline-flex",children:[A.jsx("div",{className:`${n=="primary"?"text-primary-600":"text-neutral-600"} text-sm font-medium`,children:e||""}),r?A.jsx("div",{className:`self-stretch ${n=="primary"?"text-primary-500":"text-neutral-400"} text-xs font-medium`,children:r}):null]})]}),kw=({className:t,isChecked:e,onSelect:r})=>A.jsx("input",{type:"radio",className:`accent-primary-600 cursor-pointer ${t??""}`,id:"connection",checked:e,onClick:r}),zg=({className:t,disabled:e,...r})=>A.jsx("button",{id:"btn-three-dots",className:"relative w-10 flex justify-center",...r,children:A.jsx(In.BsThreeDotsVertical,{size:18,className:`text-neutral-500 dark:text-black-200 hover:text-neutral-700 dark:hover:text-neutral-400 ${e?"opacity-50":""} ${t||""}`})}),ww=({children:t,variant:e})=>A.jsx("div",{className:`inline-flex ${e==="group"?"border border-neutral-300 divide-x rounded-lg":"gap-2"}`,children:t}),Ow=(t,e)=>{h.useEffect(()=>()=>{},[t,e])},Cw=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,searchIndex:o,searchCount:l,isAnimated:u,onFocusText:c,autoComplete:d="off",searchRef:f,onSelectResult:p,isLoading:m,...g}=t,{t:y}=Vt.useTranslation(),[b,v]=h.useState(r?.slice(0,0)),[S,E]=h.useState(0),[k,T]=h.useState(!1),[w,O]=h.useState("search"),[C,_]=h.useState(!0),N=h.useRef(null);Ow(a,f||N);const R=l?(o||0)+1:0;h.useEffect(()=>{const U=setInterval(()=>{v(r?.slice(0,S)),S+1>(r?.length||0)?E(0):E(S+1)},100);return()=>{clearInterval(U)}});const D=()=>{n?.(""),_(!C)},L=()=>{T(!0),O(c||r||"Search")},P=()=>{T(!1),O("")};return A.jsx(A.Fragment,{children:A.jsx(ze.AnimatePresence,{children:C?A.jsx(ze.motion.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.1},children:A.jsx(ar,{onClick:D,tooltip:"Search",children:A.jsx(de.SearchRounded,{className:"text-neutral-400 dark:text-white",width:"16",height:"16"})})},"searchButton"):A.jsxs(ze.motion.label,{className:B("relative flex items-center justify-start px-4 py-[9px] mt-[1px] w-[25rem] bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-[40px] border border-primary-100 dark:border-primary-800 shadow",s),initial:{opacity:0,width:0},animate:{opacity:1,width:"25rem"},exit:{opacity:0,width:0},transition:{duration:.1},children:[A.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:A.jsx(de.SearchRounded,{className:"text-neutral-400 dark:text-white dark:bg-black-700",width:"16",height:"16"})}),A.jsx(db.DebounceInput,{...g,debounceTimeout:i,id:a,autoFocus:!0,inputRef:f||N,type:"text",className:B("absolute inset-0 pl-10 w-[280px] text-sm text-neutral-900 dark:text-white bg-transparent rounded-lg focus:outline-none",s),onKeyDown:U=>{U.key==="ArrowDown"||U.key==="Enter"?(U.preventDefault(),p?.(o+1)):U.key==="ArrowUp"&&(U.preventDefault(),p?.(o-1))},value:e||"",placeholder:k?w:u?b:r||`${y("search")}...`,onChange:U=>n?.(U.target.value),autoComplete:d,onFocus:L,onBlur:P}),m?A.jsx("div",{className:"flex absolute right-0 mr-2 focus:outline-none",children:A.jsx(K4.CircularProgress,{sx:{color:"var(--color-primary-600)"},className:"text-gray-400 dark:text-black-200",size:16})}):e?A.jsxs("div",{className:"flex absolute right-0 mr-2 focus:outline-none",children:[A.jsxs(ne,{size:"small",variant:"semibold",className:"text-gray-400 dark:text-black-200 mx-2 mt-[2px]",appearance:"custom",children:[R,"/",l||0]}),A.jsx("div",{className:"w-[1px] my-[3px] bg-gray-300"}),A.jsx(de.KeyboardArrowUpRounded,{className:"cursor-pointer",onClick:()=>p?.(o-1)}),A.jsx(de.KeyboardArrowDownRounded,{className:"cursor-pointer",onClick:()=>p?.(o+1)}),A.jsx(Gl,{className:"right-0 mr-2 mt-[1px]",size:20,onClick:D})]}):A.jsx("div",{className:"flex absolute right-0 mr-2 focus:outline-none z-[52]",children:A.jsx(Gl,{classValue:"right-0 mb-[1px] mr-2 hover:cursor-pointer hover:text-neutral-700",size:20,onClick:D})})]},"searchBar")})})},x2=()=>{const{pathname:t}=qu.useLocation();h.useEffect(()=>{window.scrollTo(0,0)},[t])};var Ra=(t=>(t.COMPARISON="comparison",t.EDIT="edit",t.FOCUS_EDIT="focusEdit",t))(Ra||{});const y2=500,_w=({title:t,children:e,mode:r,displayId:n,noPadding:a=!1,className:i,noBanner:s=!1,contentClassName:o,onBannerClick:l,scrollToTopOnMount:u=!0})=>{x2();const c=h.useMemo(()=>r===Ra.EDIT||r===Ra.FOCUS_EDIT?"edit":r===Ra.COMPARISON?"compare":null,[r]),d=h.useMemo(()=>(c==="edit"&&n||c==="compare")&&!s,[c,n,s]),f=h.useMemo(()=>c==="edit"&&n?{status:"warning",message:`You're currently editing ${n}`}:c==="compare"?{status:"success",message:"You are now in Comparison Mode"}:null,[c,n]);return A.jsxs(A.Fragment,{children:[A.jsx(gs,{title:t}),A.jsxs("div",{className:ts.cn("relative h-[calc(100vh-56px)] overflow-y-auto flex flex-col bg-primary-800 dark:bg-black-800",`ease-in-out duration-${y2}`,i),children:[d&&f&&A.jsx(wo,{status:f.status,children:f.message}),A.jsx("div",{className:ts.cn("flex-1 overflow-y-auto overflow-x-hidden bg-gray-50 dark:bg-black-700",a?"p-0":"p-4",d?"rounded-tl-none":"!rounded-tl-xl",o),id:"app-body-container",children:e})]})]})};_w.displayName="PageContainer";const Nw=({title:t,meta:e,children:r})=>A.jsxs(zN.Helmet,{children:[A.jsx("title",{children:t}),e&&A.jsx("meta",{...e}),r]});Nw.displayName="Helmet";const Dw=({className:t,label:e})=>A.jsxs("div",{className:t,children:[A.jsx("div",{className:"font-bold text-xl mr-2",children:e}),A.jsx("div",{className:"mb-2 flex justify-center w-full",children:A.jsx("div",{className:"flex items-center justify-center",children:A.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600 dark:border-primary-400"})})})]});Dw.displayName="ComponentLoader";const bq=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"300",height:"200",viewBox:"0 0 300 200",children:[A.jsxs("defs",{children:[A.jsx("style",{children:`
121
121
  @keyframes offset_one_light {
122
122
  24%, 60% {
123
123
  stroke-dashoffset: 0;