@piecemaker-legal/piecemaker 2.0.11 → 2.0.12

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.
Files changed (120) hide show
  1. package/dist/assets/{FindReplaceDialog-KU5TEIBJ-BucOHLdm.js → FindReplaceDialog-KU5TEIBJ-BBxf1he7.js} +1 -1
  2. package/dist/assets/{FootnotePropertiesDialog-W3YHM4BV-D5UqbelV.js → FootnotePropertiesDialog-W3YHM4BV-BYqp6U4x.js} +1 -1
  3. package/dist/assets/{HyperlinkDialog-ZYH7ZHRF-8yEhLigd.js → HyperlinkDialog-ZYH7ZHRF-BVC9zOMs.js} +4 -4
  4. package/dist/assets/{ImagePositionDialog-HEWYR6Q3-wGIBYxCm.js → ImagePositionDialog-HEWYR6Q3-Xn2mC64y.js} +1 -1
  5. package/dist/assets/{ImagePropertiesDialog-RAB47C6M-D86PckZ2.js → ImagePropertiesDialog-RAB47C6M-CFcdqEif.js} +1 -1
  6. package/dist/assets/{PageSetupDialog-AIGIXO3E-DLETP-7v.js → PageSetupDialog-AIGIXO3E-DECaeRS9.js} +1 -1
  7. package/dist/assets/{SplitCellDialog-IFBKYCD6-CwdQBXeb.js → SplitCellDialog-IFBKYCD6-ByYa04H_.js} +1 -1
  8. package/dist/assets/{TablePropertiesDialog-TMLKGOOW-j2nA7KJs.js → TablePropertiesDialog-TMLKGOOW-BuyqZB5A.js} +1 -1
  9. package/dist/assets/{WatermarkDialog-KRL7WMIS-XFJ9gTkC.js → WatermarkDialog-KRL7WMIS-ByZ1Acr2.js} +1 -1
  10. package/dist/assets/{abnfDiagram-VCTEODGH-DiCrND_Y.js → abnfDiagram-VCTEODGH-BtttzdZA.js} +1 -1
  11. package/dist/assets/{arc-DOjgbMYz.js → arc-DN4m1tLs.js} +1 -1
  12. package/dist/assets/{architectureDiagram-5GKGNRK7-brzIFVhl.js → architectureDiagram-5GKGNRK7-Bt-zFumG.js} +1 -1
  13. package/dist/assets/{blockDiagram-I7D4REHJ-C8JhTjQQ.js → blockDiagram-I7D4REHJ-D14V8v4j.js} +1 -1
  14. package/dist/assets/{c4Diagram-7LVT6UL2-jfYxccyk.js → c4Diagram-7LVT6UL2-BynDo1-W.js} +1 -1
  15. package/dist/assets/channel-C4gJXzYa.js +1 -0
  16. package/dist/assets/{chunk-2Q5K7J3B-CrlEShp9.js → chunk-2Q5K7J3B-B8gKhSj9.js} +1 -1
  17. package/dist/assets/{chunk-5VM5RSS4-DzPlUHGq.js → chunk-5VM5RSS4-GvOpglRR.js} +1 -1
  18. package/dist/assets/{chunk-F27PBJKO-Cp9cpeWU.js → chunk-F27PBJKO-CAgZy0qc.js} +1 -1
  19. package/dist/assets/{chunk-IMKFNOWR-BifUldEN.js → chunk-IMKFNOWR-gf8Ux8Zd.js} +1 -1
  20. package/dist/assets/{chunk-JWPE2WC7-ggPEIkWu.js → chunk-JWPE2WC7-D4zFFRMp.js} +1 -1
  21. package/dist/assets/{chunk-POPQ4Y6H-3h_nayRX.js → chunk-POPQ4Y6H-Ct8X_LaT.js} +1 -1
  22. package/dist/assets/{chunk-SVP7TREG-CH29aG6J.js → chunk-SVP7TREG-g5iH1bs5.js} +1 -1
  23. package/dist/assets/{chunk-TICWLB2K-PluJUM5k.js → chunk-TICWLB2K-89-VFKTn.js} +1 -1
  24. package/dist/assets/{chunk-XXDRQBXY-DXU39Vwg.js → chunk-XXDRQBXY-CaQbdObb.js} +1 -1
  25. package/dist/assets/classDiagram-ZZMXUADV-Cm08FeYk.js +1 -0
  26. package/dist/assets/classDiagram-v2-VYDZK3BY-Cm08FeYk.js +1 -0
  27. package/dist/assets/{cose-bilkent-JH36ORCC-Dz6roYrN.js → cose-bilkent-JH36ORCC-BiYOGJAU.js} +1 -1
  28. package/dist/assets/{cynefin-OW5HDTMX-BLzrpSit.js → cynefin-OW5HDTMX-F6mJ-4tj.js} +1 -1
  29. package/dist/assets/{cynefinDiagram-5FMLGOSQ-kfxnERDZ.js → cynefinDiagram-5FMLGOSQ-q-Rggn6r.js} +1 -1
  30. package/dist/assets/{dagre-GXQ25YYZ-DP57bp-N.js → dagre-GXQ25YYZ-COqImSUH.js} +1 -1
  31. package/dist/assets/{diagram-S7CK7UJ4-DAlsrQVW.js → diagram-S7CK7UJ4-BAg1dyEc.js} +1 -1
  32. package/dist/assets/{diagram-UQ7AKVKN-By5yrMer.js → diagram-UQ7AKVKN-DFJS8qCV.js} +1 -1
  33. package/dist/assets/{diagram-VSXAHHWV-Dx89kryN.js → diagram-VSXAHHWV-BfldL35r.js} +1 -1
  34. package/dist/assets/{diagram-VX7I27RA-B9fARitZ.js → diagram-VX7I27RA-kLjovpYe.js} +1 -1
  35. package/dist/assets/{diagram-Z3DM3KII-DC15CEH1.js → diagram-Z3DM3KII-Dhwvi3Iu.js} +1 -1
  36. package/dist/assets/{ebnfDiagram-PWID7BFC-BKQzghGF.js → ebnfDiagram-PWID7BFC-Bp4YE1i7.js} +1 -1
  37. package/dist/assets/{erDiagram-RLTQ6QDP-CPY6RM7G.js → erDiagram-RLTQ6QDP-BKDdaSWz.js} +1 -1
  38. package/dist/assets/{flowDiagram-HODETNUW-4dL4GJcf.js → flowDiagram-HODETNUW-zHProVxL.js} +1 -1
  39. package/dist/assets/{ganttDiagram-EL5Y4UJY-D4-cVcfb.js → ganttDiagram-EL5Y4UJY-B-B-BI6j.js} +1 -1
  40. package/dist/assets/{gitGraphDiagram-WWUBYQGX-BMeVIEiX.js → gitGraphDiagram-WWUBYQGX-BTHMg5CH.js} +1 -1
  41. package/dist/assets/index-C5slQNvE.css +1 -0
  42. package/dist/assets/{index-DNtFDOni.js → index-CJP4dZ-c.js} +146 -146
  43. package/dist/assets/{infoDiagram-27XIBGKW-D5qMSUEU.js → infoDiagram-27XIBGKW-mabp4H9I.js} +1 -1
  44. package/dist/assets/{ishikawaDiagram-5VMMS53U-BDnyKRHm.js → ishikawaDiagram-5VMMS53U-CLNhcCrM.js} +1 -1
  45. package/dist/assets/{journeyDiagram-3NMN7TZE-dGz5ZGzq.js → journeyDiagram-3NMN7TZE-CGEi2RB6.js} +1 -1
  46. package/dist/assets/{kanban-definition-UXKFOSKX-D7UAz7o_.js → kanban-definition-UXKFOSKX-B2fLX1fK.js} +1 -1
  47. package/dist/assets/{layout-DKrmEGrz.js → layout-CloKWsFq.js} +1 -1
  48. package/dist/assets/{linear-CrTdMY-p.js → linear-BFyydI0c.js} +1 -1
  49. package/dist/assets/{mermaid.core-CXQOT5G6.js → mermaid.core-Dxl3LVAh.js} +6 -6
  50. package/dist/assets/{mindmap-definition-YA3MSWOX-VgEiYfay.js → mindmap-definition-YA3MSWOX-FT4pm55s.js} +1 -1
  51. package/dist/assets/{pegDiagram-XKGWAZYB-9IqT8gGx.js → pegDiagram-XKGWAZYB-okyIfJWM.js} +1 -1
  52. package/dist/assets/{pieDiagram-E7YTZNPT-D98pRE-t.js → pieDiagram-E7YTZNPT-NF61CQz8.js} +1 -1
  53. package/dist/assets/{quadrantDiagram-AXDQQJYC-b9PwkYzL.js → quadrantDiagram-AXDQQJYC-uVfvZzzt.js} +1 -1
  54. package/dist/assets/{railroadDiagram-O6MQD6OU-Dz87hsPE.js → railroadDiagram-O6MQD6OU-Dp8IpeoH.js} +1 -1
  55. package/dist/assets/{requirementDiagram-BXWQKSXE-CkcV73dK.js → requirementDiagram-BXWQKSXE-D8VV0oQe.js} +1 -1
  56. package/dist/assets/{sankeyDiagram-P5KCCOFB-UBN31Yrs.js → sankeyDiagram-P5KCCOFB-D-xhxjob.js} +1 -1
  57. package/dist/assets/{sequenceDiagram-WJ2MYXX4-CpQxd5Za.js → sequenceDiagram-WJ2MYXX4-BAQBK95h.js} +1 -1
  58. package/dist/assets/{sizeCapture-INFHLROL-mCsFmyzw.js → sizeCapture-INFHLROL-C6rk9SVx.js} +1 -1
  59. package/dist/assets/{stateDiagram-D77RDMKH-B0MTBN-3.js → stateDiagram-D77RDMKH-DshqaEOj.js} +1 -1
  60. package/dist/assets/{stateDiagram-v2-MP3YSRHH-DzBPN39W.js → stateDiagram-v2-MP3YSRHH-BohZIrk5.js} +1 -1
  61. package/dist/assets/{swimlanes-42K2YHIH-Dzydjm0e.js → swimlanes-42K2YHIH-DgcPDy4l.js} +1 -1
  62. package/dist/assets/swimlanesDiagram-VR7AAH4N-CuM3Su0K.js +8 -0
  63. package/dist/assets/{timeline-definition-24CTP7MA-Dz0toOLu.js → timeline-definition-24CTP7MA-OgpIe-gQ.js} +1 -1
  64. package/dist/assets/{vennDiagram-4TSXK5OY-DOWp7dkf.js → vennDiagram-4TSXK5OY-BZzGd6jt.js} +1 -1
  65. package/dist/assets/{wardleyDiagram-VM6X3IG4-CUxsztUB.js → wardleyDiagram-VM6X3IG4-1tg-H7l_.js} +1 -1
  66. package/dist/assets/{xychartDiagram-S5SC5T6Z-DS96vNED.js → xychartDiagram-S5SC5T6Z-ByTsX8g0.js} +1 -1
  67. package/dist/index.html +2 -2
  68. package/dist/sw.js +1 -1
  69. package/dist-server/plugins/piecemaker-dossier/src/knowledge.js +61 -1
  70. package/dist-server/plugins/piecemaker-dossier/src/knowledge.js.map +1 -1
  71. package/dist-server/plugins/piecemaker-dossier/src/scan-result.js +0 -48
  72. package/dist-server/plugins/piecemaker-dossier/src/scan-result.js.map +1 -1
  73. package/dist-server/server/piecemaker/knowledge/pipeline.js +25 -29
  74. package/dist-server/server/piecemaker/knowledge/pipeline.js.map +1 -1
  75. package/dist-server/server/piecemaker/knowledge/service.js +1 -16
  76. package/dist-server/server/piecemaker/knowledge/service.js.map +1 -1
  77. package/dist-server/server/piecemaker/project-registry.js +5 -5
  78. package/dist-server/server/piecemaker/project-registry.js.map +1 -1
  79. package/package.json +1 -1
  80. package/server/piecemaker/anonymizer/hudsucker-fixture.cjs +1 -1
  81. package/server/piecemaker/anonymizer/hudsucker-proxy/src/main.rs +2 -1
  82. package/server/piecemaker/anonymizer/rewrite.cjs +2 -2
  83. package/server/piecemaker/anonymizer/service.cjs +3 -2
  84. package/server/piecemaker/anonymizer/sqlite-dictionary.cjs +3 -31
  85. package/server/piecemaker/index.ts +1 -1
  86. package/server/piecemaker/knowledge/pipeline.ts +24 -31
  87. package/server/piecemaker/knowledge/service.ts +1 -14
  88. package/server/piecemaker/project-registry.ts +6 -6
  89. package/server/piecemaker/vendor/installer/bin/piecemaker.mjs +9 -162
  90. package/server/piecemaker/vendor/installer/lib/commandes.mjs +1 -2
  91. package/server/piecemaker/vendor/installer/lib/conversion-client.mjs +62 -3
  92. package/server/piecemaker/vendor/installer/steps/06-hooks.mjs +23 -69
  93. package/server/piecemaker/vendor/installer/steps/12-mcp-piecemaker.mjs +3 -3
  94. package/server/piecemaker/vendor/mcp/README.md +1 -1
  95. package/server/piecemaker/vendor/mcp/piecemaker/server.mjs +12 -75
  96. package/server/piecemaker/vendor/piecemaker-plugin/hooks/hooks.json +0 -40
  97. package/server/piecemaker/vendor/piecemaker-plugin/scripts/compile-recherche.mjs +2 -2
  98. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/case-folders.cjs +26 -7
  99. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/commits.cjs +0 -28
  100. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/hook-io.mjs +0 -13
  101. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/institutional-terms.cjs +3 -3
  102. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/mapping.cjs +10 -143
  103. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/protection.cjs +1 -1
  104. package/server/piecemaker/vendor/piecemaker-plugin/scripts/lib/session-timing.cjs +0 -65
  105. package/server/piecemaker/vendor/piecemaker-plugin/scripts/protect-originals.mjs +11 -2
  106. package/server/piecemaker/vendor/piecemaker-plugin/skills/conversion-md/SKILL.md +9 -5
  107. package/server/piecemaker/vendor/websocket-server/admin-routes.cjs +2 -150
  108. package/server/piecemaker/vendor/websocket-server/claude-hooks.cjs +3 -0
  109. package/server/piecemaker/vendor/websocket-server/originals-pipeline.cjs +23 -372
  110. package/server/piecemaker/vendor/websocket-server/renamed-originals.cjs +136 -0
  111. package/server/piecemaker/vendor/websocket-server/scripts/convert_and_scan_pipeline.py +115 -96
  112. package/dist/assets/channel-Dajzu2W1.js +0 -1
  113. package/dist/assets/classDiagram-ZZMXUADV-dDEP_giv.js +0 -1
  114. package/dist/assets/classDiagram-v2-VYDZK3BY-dDEP_giv.js +0 -1
  115. package/dist/assets/index-Dc9wNuS4.css +0 -1
  116. package/dist/assets/swimlanesDiagram-VR7AAH4N-BXQpbUMD.js +0 -8
  117. package/server/piecemaker/vendor/piecemaker-plugin/scripts/billing-track.mjs +0 -194
  118. package/server/piecemaker/vendor/piecemaker-plugin/scripts/commit-track.mjs +0 -71
  119. package/server/piecemaker/vendor/piecemaker-plugin/scripts/session-commit-worker.mjs +0 -260
  120. package/server/piecemaker/vendor/piecemaker-plugin/scripts/session-commit.mjs +0 -83
@@ -1 +1 @@
1
- import{L as xe,r as c}from"./HyperlinkDialog-ZYH7ZHRF-8yEhLigd.js";import{P as Ve}from"./HyperlinkDialog-ZYH7ZHRF-8yEhLigd.js";import{a}from"./vendor-react-B22wqN3J.js";import{j as t}from"./vendor-codemirror-CN-sJePf.js";import"./index-DNtFDOni.js";import"./vendor-xterm-BWUgpGtR.js";var fe={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent",display:"flex",alignItems:"flex-start",justifyContent:"flex-end",zIndex:1e4,pointerEvents:"none"},ge={backgroundColor:"var(--doc-surface)",borderRadius:"4px",boxShadow:"0 4px 20px var(--doc-shadow)",minWidth:"360px",maxWidth:"440px",width:"100%",margin:"60px 20px 20px 20px",pointerEvents:"auto"},he={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg-subtle)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},me={margin:0,fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},be={background:"none",border:"none",fontSize:"18px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"2px 6px",lineHeight:1},ve={padding:"16px"},Q={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},V={width:"60px",fontSize:"13px",color:"var(--doc-text)",flexShrink:0},D={flex:1,padding:"8px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",fontSize:"13px",boxSizing:"border-box",outline:"none"},X={...D,borderColor:"var(--doc-link)",boxShadow:"0 0 0 2px var(--doc-focus-ring)"},ye={display:"flex",flexDirection:"column",gap:"6px",marginLeft:"8px"},F={padding:"6px 12px",borderRadius:"3px",fontSize:"12px",fontWeight:500,cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)",minWidth:"80px",textAlign:"center"},Z={...F,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text-placeholder)",cursor:"not-allowed"},T={padding:"6px 10px",borderRadius:"3px",fontSize:"14px",cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)"},$={...T,color:"var(--doc-border-input)",cursor:"not-allowed"},Ce={display:"flex",gap:"16px",marginTop:"4px",marginLeft:"68px"},N={display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--doc-text-muted)",cursor:"pointer"},q={width:"14px",height:"14px",cursor:"pointer"},U={marginLeft:"68px",fontSize:"12px",color:"var(--doc-text-muted)",marginBottom:"8px"},ke={...U,color:"var(--doc-error)"},Re=220,je=({style:s})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:s,children:t.jsx("polyline",{points:"18 15 12 9 6 15"})}),We=({style:s})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:s,children:t.jsx("polyline",{points:"6 9 12 15 18 9"})});function Ie({isOpen:s,onClose:x,onFind:g,onFindNext:E,onFindPrevious:A,onReplace:_,onReplaceAll:P,onHighlightMatches:f,onClearHighlights:y,initialSearchText:L="",replaceMode:C=!1,currentResult:k,className:Y,style:ee}){let{t:r}=xe(),[o,z]=a.useState(""),[h,M]=a.useState(""),[R,B]=a.useState(C),[n,te]=a.useState(!1),[i,ae]=a.useState(!1),[l,p]=a.useState(null),[le,O]=a.useState(!1),[oe,H]=a.useState(!1),j=a.useRef(null),K=a.useRef(null),G=a.useRef(g),J=a.useRef(f),m=a.useRef(y);a.useEffect(()=>{G.current=g,J.current=f,m.current=y},[g,f,y]),a.useEffect(()=>{k!==void 0&&p(k)},[k]),a.useEffect(()=>{s?(z(L),M(""),B(C),p(null),setTimeout(()=>{j.current?.focus(),j.current?.select()},100)):m.current?.()},[s,L,C]);let b=a.useCallback(()=>{p(null),m.current?.()},[]),d=a.useCallback((e,v)=>{if(!e.trim()){b();return}let w=G.current(e,v);p(w),w?.matches?J.current?.(w.matches):m.current?.()},[b]);a.useEffect(()=>{if(!s)return;if(!o.trim()){b();return}let e=window.setTimeout(()=>{d(o,{matchCase:n,matchWholeWord:i})},Re);return()=>window.clearTimeout(e)},[s,o,n,i,d,b]);let re=a.useCallback(e=>{z(e.target.value),p(null)},[]),W=a.useCallback(()=>{if(!o.trim()){d(o,{matchCase:n,matchWholeWord:i});return}if(!l){d(o,{matchCase:n,matchWholeWord:i});return}if(E()&&l){let e=(l.currentIndex+1)%l.totalCount;p({...l,currentIndex:e})}},[o,n,i,l,d,E]),I=a.useCallback(()=>{if(!o.trim()){d(o,{matchCase:n,matchWholeWord:i});return}if(!l){d(o,{matchCase:n,matchWholeWord:i});return}if(A()&&l){let e=l.currentIndex===0?l.totalCount-1:l.currentIndex-1;p({...l,currentIndex:e})}},[o,n,i,l,d,A]),ne=a.useCallback(e=>{e.key==="Enter"?(e.preventDefault(),e.shiftKey?I():l?W():d(o,{matchCase:n,matchWholeWord:i})):e.key==="Escape"&&x()},[l,o,n,i,d,W,I,x]),S=a.useCallback(()=>{if(!(!l||l.totalCount===0)&&_(h)){let e=g(o,{matchCase:n,matchWholeWord:i});p(e),e?.matches&&f&&f(e.matches)}},[l,h,o,n,i,_,g,f]),ie=a.useCallback(e=>{e.key==="Enter"?(e.preventDefault(),S()):e.key==="Escape"&&x()},[S,x]),ce=a.useCallback(()=>{o.trim()&&P(o,h,{matchCase:n,matchWholeWord:i})>0&&(p(null),m.current?.())},[o,h,n,i,P]),de=a.useCallback(()=>{B(e=>{let v=!e;return v&&setTimeout(()=>K.current?.focus(),100),v})},[]),se=a.useCallback(e=>{e.target,e.currentTarget},[]),pe=a.useCallback(e=>{e.key==="Escape"&&x()},[x]);if(!s)return null;let u=l&&l.totalCount>0,ue=l&&l.totalCount===0&&o.trim();return t.jsx("div",{className:`docx-find-replace-dialog-overlay ${Y||""}`,style:{...fe,...ee},onClick:se,onKeyDown:pe,children:t.jsxs("div",{className:"docx-find-replace-dialog","data-testid":"find-replace-dialog",style:ge,role:"dialog","aria-modal":"false","aria-labelledby":"find-replace-dialog-title",children:[t.jsxs("div",{className:"docx-find-replace-dialog-header",style:he,children:[t.jsx("h2",{id:"find-replace-dialog-title",style:me,children:r(R?"dialogs.findReplace.titleFindReplace":"dialogs.findReplace.titleFind")}),t.jsx("button",{type:"button",className:"docx-find-replace-dialog-close",style:be,onClick:x,"aria-label":r("common.closeDialog"),children:"×"})]}),t.jsxs("div",{className:"docx-find-replace-dialog-body",style:ve,children:[t.jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[t.jsx("label",{htmlFor:"find-text",style:V,children:r("dialogs.findReplace.findLabel")}),t.jsx("input",{ref:j,id:"find-text",type:"text",className:"docx-find-replace-dialog-input",style:le?X:D,value:o,onChange:re,onKeyDown:ne,onFocus:()=>O(!0),onBlur:()=>{O(!1),o.trim()&&!l&&d(o,{matchCase:n,matchWholeWord:i})},placeholder:r("dialogs.findReplace.findPlaceholder"),"aria-label":r("dialogs.findReplace.findAriaLabel")}),t.jsxs("div",{style:{display:"flex",gap:"4px"},children:[t.jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:u?T:$,onClick:I,disabled:!u,"aria-label":r("dialogs.findReplace.findPrevious"),title:r("dialogs.findReplace.findPreviousTitle"),children:t.jsx(je,{})}),t.jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:u?T:$,onClick:W,disabled:!u,"aria-label":r("dialogs.findReplace.findNext"),title:r("dialogs.findReplace.findNextTitle"),children:t.jsx(We,{})})]})]}),u&&t.jsx("div",{className:"docx-find-replace-dialog-status",style:U,children:r("dialogs.findReplace.matchCount",{current:l.currentIndex+1,total:l.totalCount})}),ue&&t.jsx("div",{className:"docx-find-replace-dialog-status",style:ke,children:r("dialogs.findReplace.noResults")}),R&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[t.jsx("label",{htmlFor:"replace-text",style:V,children:r("dialogs.findReplace.replaceLabel")}),t.jsx("input",{ref:K,id:"replace-text",type:"text",className:"docx-find-replace-dialog-input",style:oe?X:D,value:h,onChange:e=>M(e.target.value),onKeyDown:ie,onFocus:()=>H(!0),onBlur:()=>H(!1),placeholder:r("dialogs.findReplace.replacePlaceholder"),"aria-label":r("dialogs.findReplace.replaceAriaLabel")}),t.jsxs("div",{style:ye,children:[t.jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:u?F:Z,onClick:S,disabled:!u,title:r("dialogs.findReplace.replaceCurrentTitle"),children:r("dialogs.findReplace.replaceButton")}),t.jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:u?F:Z,onClick:ce,disabled:!u,title:r("dialogs.findReplace.replaceAllTitle"),children:r("dialogs.findReplace.replaceAllButton")})]})]})}),t.jsxs("div",{className:"docx-find-replace-dialog-options",style:Ce,children:[t.jsxs("label",{className:"docx-find-replace-dialog-option",style:N,children:[t.jsx("input",{type:"checkbox",style:q,checked:n,onChange:e=>te(e.target.checked)}),r("dialogs.findReplace.matchCase")]}),t.jsxs("label",{className:"docx-find-replace-dialog-option",style:N,children:[t.jsx("input",{type:"checkbox",style:q,checked:i,onChange:e=>ae(e.target.checked)}),r("dialogs.findReplace.wholeWords")]}),!R&&t.jsx("button",{type:"button",style:{...N,background:"none",border:"none",cursor:"pointer",color:"var(--doc-link)",padding:0},onClick:de,children:r("dialogs.findReplace.toggleReplace")})]})]})]})})}var Te=Ie,Ee=c.createDefaultFindOptions,Ae=c.createSearchPattern,_e=c.escapeRegexString,Pe=c.findAllMatches,Le=c.findInDocument,ze=c.findInParagraph,Me=c.getDefaultHighlightOptions,Be=c.getMatchCountText,Oe=c.isEmptySearch,He=c.replaceAllInContent,Ke=c.replaceFirstInContent,Ge=c.scrollToMatch;export{Ie as FindReplaceDialog,Ee as createDefaultFindOptions,Ae as createSearchPattern,Te as default,_e as escapeRegexString,Pe as findAllMatches,Le as findInDocument,ze as findInParagraph,Me as getDefaultHighlightOptions,Be as getMatchCountText,Oe as isEmptySearch,He as replaceAllInContent,Ke as replaceFirstInContent,Ge as scrollToMatch,Ve as useFindReplace};
1
+ import{L as xe,r as c}from"./HyperlinkDialog-ZYH7ZHRF-BVC9zOMs.js";import{P as Ve}from"./HyperlinkDialog-ZYH7ZHRF-BVC9zOMs.js";import{a}from"./vendor-react-B22wqN3J.js";import{j as t}from"./vendor-codemirror-CN-sJePf.js";import"./index-CJP4dZ-c.js";import"./vendor-xterm-BWUgpGtR.js";var fe={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent",display:"flex",alignItems:"flex-start",justifyContent:"flex-end",zIndex:1e4,pointerEvents:"none"},ge={backgroundColor:"var(--doc-surface)",borderRadius:"4px",boxShadow:"0 4px 20px var(--doc-shadow)",minWidth:"360px",maxWidth:"440px",width:"100%",margin:"60px 20px 20px 20px",pointerEvents:"auto"},he={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg-subtle)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},me={margin:0,fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},be={background:"none",border:"none",fontSize:"18px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"2px 6px",lineHeight:1},ve={padding:"16px"},Q={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},V={width:"60px",fontSize:"13px",color:"var(--doc-text)",flexShrink:0},D={flex:1,padding:"8px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",fontSize:"13px",boxSizing:"border-box",outline:"none"},X={...D,borderColor:"var(--doc-link)",boxShadow:"0 0 0 2px var(--doc-focus-ring)"},ye={display:"flex",flexDirection:"column",gap:"6px",marginLeft:"8px"},F={padding:"6px 12px",borderRadius:"3px",fontSize:"12px",fontWeight:500,cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)",minWidth:"80px",textAlign:"center"},Z={...F,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text-placeholder)",cursor:"not-allowed"},T={padding:"6px 10px",borderRadius:"3px",fontSize:"14px",cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)"},$={...T,color:"var(--doc-border-input)",cursor:"not-allowed"},Ce={display:"flex",gap:"16px",marginTop:"4px",marginLeft:"68px"},N={display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--doc-text-muted)",cursor:"pointer"},q={width:"14px",height:"14px",cursor:"pointer"},U={marginLeft:"68px",fontSize:"12px",color:"var(--doc-text-muted)",marginBottom:"8px"},ke={...U,color:"var(--doc-error)"},Re=220,je=({style:s})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:s,children:t.jsx("polyline",{points:"18 15 12 9 6 15"})}),We=({style:s})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:s,children:t.jsx("polyline",{points:"6 9 12 15 18 9"})});function Ie({isOpen:s,onClose:x,onFind:g,onFindNext:E,onFindPrevious:A,onReplace:_,onReplaceAll:P,onHighlightMatches:f,onClearHighlights:y,initialSearchText:L="",replaceMode:C=!1,currentResult:k,className:Y,style:ee}){let{t:r}=xe(),[o,z]=a.useState(""),[h,M]=a.useState(""),[R,B]=a.useState(C),[n,te]=a.useState(!1),[i,ae]=a.useState(!1),[l,p]=a.useState(null),[le,O]=a.useState(!1),[oe,H]=a.useState(!1),j=a.useRef(null),K=a.useRef(null),G=a.useRef(g),J=a.useRef(f),m=a.useRef(y);a.useEffect(()=>{G.current=g,J.current=f,m.current=y},[g,f,y]),a.useEffect(()=>{k!==void 0&&p(k)},[k]),a.useEffect(()=>{s?(z(L),M(""),B(C),p(null),setTimeout(()=>{j.current?.focus(),j.current?.select()},100)):m.current?.()},[s,L,C]);let b=a.useCallback(()=>{p(null),m.current?.()},[]),d=a.useCallback((e,v)=>{if(!e.trim()){b();return}let w=G.current(e,v);p(w),w?.matches?J.current?.(w.matches):m.current?.()},[b]);a.useEffect(()=>{if(!s)return;if(!o.trim()){b();return}let e=window.setTimeout(()=>{d(o,{matchCase:n,matchWholeWord:i})},Re);return()=>window.clearTimeout(e)},[s,o,n,i,d,b]);let re=a.useCallback(e=>{z(e.target.value),p(null)},[]),W=a.useCallback(()=>{if(!o.trim()){d(o,{matchCase:n,matchWholeWord:i});return}if(!l){d(o,{matchCase:n,matchWholeWord:i});return}if(E()&&l){let e=(l.currentIndex+1)%l.totalCount;p({...l,currentIndex:e})}},[o,n,i,l,d,E]),I=a.useCallback(()=>{if(!o.trim()){d(o,{matchCase:n,matchWholeWord:i});return}if(!l){d(o,{matchCase:n,matchWholeWord:i});return}if(A()&&l){let e=l.currentIndex===0?l.totalCount-1:l.currentIndex-1;p({...l,currentIndex:e})}},[o,n,i,l,d,A]),ne=a.useCallback(e=>{e.key==="Enter"?(e.preventDefault(),e.shiftKey?I():l?W():d(o,{matchCase:n,matchWholeWord:i})):e.key==="Escape"&&x()},[l,o,n,i,d,W,I,x]),S=a.useCallback(()=>{if(!(!l||l.totalCount===0)&&_(h)){let e=g(o,{matchCase:n,matchWholeWord:i});p(e),e?.matches&&f&&f(e.matches)}},[l,h,o,n,i,_,g,f]),ie=a.useCallback(e=>{e.key==="Enter"?(e.preventDefault(),S()):e.key==="Escape"&&x()},[S,x]),ce=a.useCallback(()=>{o.trim()&&P(o,h,{matchCase:n,matchWholeWord:i})>0&&(p(null),m.current?.())},[o,h,n,i,P]),de=a.useCallback(()=>{B(e=>{let v=!e;return v&&setTimeout(()=>K.current?.focus(),100),v})},[]),se=a.useCallback(e=>{e.target,e.currentTarget},[]),pe=a.useCallback(e=>{e.key==="Escape"&&x()},[x]);if(!s)return null;let u=l&&l.totalCount>0,ue=l&&l.totalCount===0&&o.trim();return t.jsx("div",{className:`docx-find-replace-dialog-overlay ${Y||""}`,style:{...fe,...ee},onClick:se,onKeyDown:pe,children:t.jsxs("div",{className:"docx-find-replace-dialog","data-testid":"find-replace-dialog",style:ge,role:"dialog","aria-modal":"false","aria-labelledby":"find-replace-dialog-title",children:[t.jsxs("div",{className:"docx-find-replace-dialog-header",style:he,children:[t.jsx("h2",{id:"find-replace-dialog-title",style:me,children:r(R?"dialogs.findReplace.titleFindReplace":"dialogs.findReplace.titleFind")}),t.jsx("button",{type:"button",className:"docx-find-replace-dialog-close",style:be,onClick:x,"aria-label":r("common.closeDialog"),children:"×"})]}),t.jsxs("div",{className:"docx-find-replace-dialog-body",style:ve,children:[t.jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[t.jsx("label",{htmlFor:"find-text",style:V,children:r("dialogs.findReplace.findLabel")}),t.jsx("input",{ref:j,id:"find-text",type:"text",className:"docx-find-replace-dialog-input",style:le?X:D,value:o,onChange:re,onKeyDown:ne,onFocus:()=>O(!0),onBlur:()=>{O(!1),o.trim()&&!l&&d(o,{matchCase:n,matchWholeWord:i})},placeholder:r("dialogs.findReplace.findPlaceholder"),"aria-label":r("dialogs.findReplace.findAriaLabel")}),t.jsxs("div",{style:{display:"flex",gap:"4px"},children:[t.jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:u?T:$,onClick:I,disabled:!u,"aria-label":r("dialogs.findReplace.findPrevious"),title:r("dialogs.findReplace.findPreviousTitle"),children:t.jsx(je,{})}),t.jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:u?T:$,onClick:W,disabled:!u,"aria-label":r("dialogs.findReplace.findNext"),title:r("dialogs.findReplace.findNextTitle"),children:t.jsx(We,{})})]})]}),u&&t.jsx("div",{className:"docx-find-replace-dialog-status",style:U,children:r("dialogs.findReplace.matchCount",{current:l.currentIndex+1,total:l.totalCount})}),ue&&t.jsx("div",{className:"docx-find-replace-dialog-status",style:ke,children:r("dialogs.findReplace.noResults")}),R&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"docx-find-replace-dialog-row",style:Q,children:[t.jsx("label",{htmlFor:"replace-text",style:V,children:r("dialogs.findReplace.replaceLabel")}),t.jsx("input",{ref:K,id:"replace-text",type:"text",className:"docx-find-replace-dialog-input",style:oe?X:D,value:h,onChange:e=>M(e.target.value),onKeyDown:ie,onFocus:()=>H(!0),onBlur:()=>H(!1),placeholder:r("dialogs.findReplace.replacePlaceholder"),"aria-label":r("dialogs.findReplace.replaceAriaLabel")}),t.jsxs("div",{style:ye,children:[t.jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:u?F:Z,onClick:S,disabled:!u,title:r("dialogs.findReplace.replaceCurrentTitle"),children:r("dialogs.findReplace.replaceButton")}),t.jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:u?F:Z,onClick:ce,disabled:!u,title:r("dialogs.findReplace.replaceAllTitle"),children:r("dialogs.findReplace.replaceAllButton")})]})]})}),t.jsxs("div",{className:"docx-find-replace-dialog-options",style:Ce,children:[t.jsxs("label",{className:"docx-find-replace-dialog-option",style:N,children:[t.jsx("input",{type:"checkbox",style:q,checked:n,onChange:e=>te(e.target.checked)}),r("dialogs.findReplace.matchCase")]}),t.jsxs("label",{className:"docx-find-replace-dialog-option",style:N,children:[t.jsx("input",{type:"checkbox",style:q,checked:i,onChange:e=>ae(e.target.checked)}),r("dialogs.findReplace.wholeWords")]}),!R&&t.jsx("button",{type:"button",style:{...N,background:"none",border:"none",cursor:"pointer",color:"var(--doc-link)",padding:0},onClick:de,children:r("dialogs.findReplace.toggleReplace")})]})]})]})})}var Te=Ie,Ee=c.createDefaultFindOptions,Ae=c.createSearchPattern,_e=c.escapeRegexString,Pe=c.findAllMatches,Le=c.findInDocument,ze=c.findInParagraph,Me=c.getDefaultHighlightOptions,Be=c.getMatchCountText,Oe=c.isEmptySearch,He=c.replaceAllInContent,Ke=c.replaceFirstInContent,Ge=c.scrollToMatch;export{Ie as FindReplaceDialog,Ee as createDefaultFindOptions,Ae as createSearchPattern,Te as default,_e as escapeRegexString,Pe as findAllMatches,Le as findInDocument,ze as findInParagraph,Me as getDefaultHighlightOptions,Be as getMatchCountText,Oe as isEmptySearch,He as replaceAllInContent,Ke as replaceFirstInContent,Ge as scrollToMatch,Ve as useFindReplace};
@@ -1 +1 @@
1
- import{L as B}from"./HyperlinkDialog-ZYH7ZHRF-8yEhLigd.js";import{a as n}from"./vendor-react-B22wqN3J.js";import{j as e}from"./vendor-codemirror-CN-sJePf.js";import"./index-DNtFDOni.js";import"./vendor-xterm-BWUgpGtR.js";var A={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"var(--doc-overlay)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},E={backgroundColor:"var(--doc-surface)",borderRadius:8,boxShadow:"0 4px 20px var(--doc-shadow)",padding:24,minWidth:400,maxWidth:500},f={marginBottom:16,padding:12,border:"1px solid var(--doc-border)",borderRadius:4},r={display:"block",fontSize:12,color:"var(--doc-text-muted)",marginBottom:4},i={width:"100%",padding:"4px 8px",border:"1px solid var(--doc-border-input)",borderRadius:4,fontSize:13,marginBottom:8},b={width:60,padding:"4px 8px",border:"1px solid var(--doc-border-input)",borderRadius:4,fontSize:13,marginBottom:8},I={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},j={padding:"6px 16px",border:"1px solid var(--doc-border-input)",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"var(--doc-surface)"},L={...j,backgroundColor:"var(--doc-primary)",color:"var(--doc-on-primary)",border:"1px solid var(--doc-primary)"},y=[{value:"decimal",labelKey:"dialogs.footnoteProperties.formats.decimal"},{value:"lowerRoman",labelKey:"dialogs.footnoteProperties.formats.lowerRoman"},{value:"upperRoman",labelKey:"dialogs.footnoteProperties.formats.upperRoman"},{value:"lowerLetter",labelKey:"dialogs.footnoteProperties.formats.lowerAlpha"},{value:"upperLetter",labelKey:"dialogs.footnoteProperties.formats.upperAlpha"},{value:"chicago",labelKey:"dialogs.footnoteProperties.formats.symbols"}];function N({isOpen:P,onClose:s,onApply:v,footnotePr:l,endnotePr:a}){let{t}=B(),[d,S]=n.useState(l?.position??"pageBottom"),[p,C]=n.useState(l?.numFmt??"decimal"),[u,R]=n.useState(l?.numStart??1),[c,k]=n.useState(l?.numRestart??"continuous"),[m,w]=n.useState(a?.position??"docEnd"),[g,O]=n.useState(a?.numFmt??"lowerRoman"),[x,z]=n.useState(a?.numStart??1),[h,K]=n.useState(a?.numRestart??"continuous"),F=n.useCallback(()=>{v({position:d,numFmt:p,numStart:u,numRestart:c},{position:m,numFmt:g,numStart:x,numRestart:h}),s()},[d,p,u,c,m,g,x,h,v,s]);return P?e.jsx("div",{style:A,onClick:s,children:e.jsxs("div",{style:E,onClick:o=>o.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:t("dialogs.footnoteProperties.title")}),e.jsxs("div",{style:f,children:[e.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:t("dialogs.footnoteProperties.footnotes")}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.position")}),e.jsxs("select",{style:i,value:d,onChange:o=>S(o.target.value),children:[e.jsx("option",{value:"pageBottom",children:t("dialogs.footnoteProperties.footnotePositions.bottomOfPage")}),e.jsx("option",{value:"beneathText",children:t("dialogs.footnoteProperties.footnotePositions.belowText")})]}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numberFormat")}),e.jsx("select",{style:i,value:p,onChange:o=>C(o.target.value),children:y.map(o=>e.jsx("option",{value:o.value,children:t(o.labelKey)},o.value))}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.startAt")}),e.jsx("input",{type:"number",min:1,style:b,value:u,onChange:o=>R(parseInt(o.target.value,10)||1)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numbering")}),e.jsxs("select",{style:i,value:c,onChange:o=>k(o.target.value),children:[e.jsx("option",{value:"continuous",children:t("dialogs.footnoteProperties.numberingOptions.continuous")}),e.jsx("option",{value:"eachSect",children:t("dialogs.footnoteProperties.numberingOptions.restartSection")}),e.jsx("option",{value:"eachPage",children:t("dialogs.footnoteProperties.numberingOptions.restartPage")})]})]})]})]}),e.jsxs("div",{style:f,children:[e.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:t("dialogs.footnoteProperties.endnotes")}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.position")}),e.jsxs("select",{style:i,value:m,onChange:o=>w(o.target.value),children:[e.jsx("option",{value:"docEnd",children:t("dialogs.footnoteProperties.endnotePositions.endOfDocument")}),e.jsx("option",{value:"sectEnd",children:t("dialogs.footnoteProperties.endnotePositions.endOfSection")})]}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numberFormat")}),e.jsx("select",{style:i,value:g,onChange:o=>O(o.target.value),children:y.map(o=>e.jsx("option",{value:o.value,children:t(o.labelKey)},o.value))}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.startAt")}),e.jsx("input",{type:"number",min:1,style:b,value:x,onChange:o=>z(parseInt(o.target.value,10)||1)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numbering")}),e.jsxs("select",{style:i,value:h,onChange:o=>K(o.target.value),children:[e.jsx("option",{value:"continuous",children:t("dialogs.footnoteProperties.numberingOptions.continuous")}),e.jsx("option",{value:"eachSect",children:t("dialogs.footnoteProperties.numberingOptions.restartSection")})]})]})]})]}),e.jsxs("div",{style:I,children:[e.jsx("button",{style:j,onClick:s,children:t("common.cancel")}),e.jsx("button",{style:L,onClick:F,children:t("common.apply")})]})]})}):null}export{N as FootnotePropertiesDialog};
1
+ import{L as B}from"./HyperlinkDialog-ZYH7ZHRF-BVC9zOMs.js";import{a as n}from"./vendor-react-B22wqN3J.js";import{j as e}from"./vendor-codemirror-CN-sJePf.js";import"./index-CJP4dZ-c.js";import"./vendor-xterm-BWUgpGtR.js";var A={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"var(--doc-overlay)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},E={backgroundColor:"var(--doc-surface)",borderRadius:8,boxShadow:"0 4px 20px var(--doc-shadow)",padding:24,minWidth:400,maxWidth:500},f={marginBottom:16,padding:12,border:"1px solid var(--doc-border)",borderRadius:4},r={display:"block",fontSize:12,color:"var(--doc-text-muted)",marginBottom:4},i={width:"100%",padding:"4px 8px",border:"1px solid var(--doc-border-input)",borderRadius:4,fontSize:13,marginBottom:8},b={width:60,padding:"4px 8px",border:"1px solid var(--doc-border-input)",borderRadius:4,fontSize:13,marginBottom:8},I={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},j={padding:"6px 16px",border:"1px solid var(--doc-border-input)",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"var(--doc-surface)"},L={...j,backgroundColor:"var(--doc-primary)",color:"var(--doc-on-primary)",border:"1px solid var(--doc-primary)"},y=[{value:"decimal",labelKey:"dialogs.footnoteProperties.formats.decimal"},{value:"lowerRoman",labelKey:"dialogs.footnoteProperties.formats.lowerRoman"},{value:"upperRoman",labelKey:"dialogs.footnoteProperties.formats.upperRoman"},{value:"lowerLetter",labelKey:"dialogs.footnoteProperties.formats.lowerAlpha"},{value:"upperLetter",labelKey:"dialogs.footnoteProperties.formats.upperAlpha"},{value:"chicago",labelKey:"dialogs.footnoteProperties.formats.symbols"}];function N({isOpen:P,onClose:s,onApply:v,footnotePr:l,endnotePr:a}){let{t}=B(),[d,S]=n.useState(l?.position??"pageBottom"),[p,C]=n.useState(l?.numFmt??"decimal"),[u,R]=n.useState(l?.numStart??1),[c,k]=n.useState(l?.numRestart??"continuous"),[m,w]=n.useState(a?.position??"docEnd"),[g,O]=n.useState(a?.numFmt??"lowerRoman"),[x,z]=n.useState(a?.numStart??1),[h,K]=n.useState(a?.numRestart??"continuous"),F=n.useCallback(()=>{v({position:d,numFmt:p,numStart:u,numRestart:c},{position:m,numFmt:g,numStart:x,numRestart:h}),s()},[d,p,u,c,m,g,x,h,v,s]);return P?e.jsx("div",{style:A,onClick:s,children:e.jsxs("div",{style:E,onClick:o=>o.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:t("dialogs.footnoteProperties.title")}),e.jsxs("div",{style:f,children:[e.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:t("dialogs.footnoteProperties.footnotes")}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.position")}),e.jsxs("select",{style:i,value:d,onChange:o=>S(o.target.value),children:[e.jsx("option",{value:"pageBottom",children:t("dialogs.footnoteProperties.footnotePositions.bottomOfPage")}),e.jsx("option",{value:"beneathText",children:t("dialogs.footnoteProperties.footnotePositions.belowText")})]}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numberFormat")}),e.jsx("select",{style:i,value:p,onChange:o=>C(o.target.value),children:y.map(o=>e.jsx("option",{value:o.value,children:t(o.labelKey)},o.value))}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.startAt")}),e.jsx("input",{type:"number",min:1,style:b,value:u,onChange:o=>R(parseInt(o.target.value,10)||1)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numbering")}),e.jsxs("select",{style:i,value:c,onChange:o=>k(o.target.value),children:[e.jsx("option",{value:"continuous",children:t("dialogs.footnoteProperties.numberingOptions.continuous")}),e.jsx("option",{value:"eachSect",children:t("dialogs.footnoteProperties.numberingOptions.restartSection")}),e.jsx("option",{value:"eachPage",children:t("dialogs.footnoteProperties.numberingOptions.restartPage")})]})]})]})]}),e.jsxs("div",{style:f,children:[e.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:t("dialogs.footnoteProperties.endnotes")}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.position")}),e.jsxs("select",{style:i,value:m,onChange:o=>w(o.target.value),children:[e.jsx("option",{value:"docEnd",children:t("dialogs.footnoteProperties.endnotePositions.endOfDocument")}),e.jsx("option",{value:"sectEnd",children:t("dialogs.footnoteProperties.endnotePositions.endOfSection")})]}),e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numberFormat")}),e.jsx("select",{style:i,value:g,onChange:o=>O(o.target.value),children:y.map(o=>e.jsx("option",{value:o.value,children:t(o.labelKey)},o.value))}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.startAt")}),e.jsx("input",{type:"number",min:1,style:b,value:x,onChange:o=>z(parseInt(o.target.value,10)||1)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:r,children:t("dialogs.footnoteProperties.numbering")}),e.jsxs("select",{style:i,value:h,onChange:o=>K(o.target.value),children:[e.jsx("option",{value:"continuous",children:t("dialogs.footnoteProperties.numberingOptions.continuous")}),e.jsx("option",{value:"eachSect",children:t("dialogs.footnoteProperties.numberingOptions.restartSection")})]})]})]})]}),e.jsxs("div",{style:I,children:[e.jsx("button",{style:j,onClick:s,children:t("common.cancel")}),e.jsx("button",{style:L,onClick:F,children:t("common.apply")})]})]})}):null}export{N as FootnotePropertiesDialog};