intlayer-editor 9.0.0-canary.9 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/bin/intlayer-editor.mjs +1 -1
  2. package/client/dist/assets/{CodeBlockShiki-Chs2ExZH.js → CodeBlockShiki-A-v61zjd.js} +2 -2
  3. package/client/dist/assets/MarkDownRender-Bih9GMw2.js +1 -0
  4. package/client/dist/assets/MarkDownRender-Ch7Z1Ufx.js +22 -0
  5. package/client/dist/assets/MarkdownEditor-CHph_zfu.js +195 -0
  6. package/client/dist/assets/{bundle-web-D5cR0ASE.js → bundle-web-C9o3DdSr.js} +1 -1
  7. package/client/dist/assets/dist-D-jIFBiN.js +12 -0
  8. package/client/dist/assets/{dist-CVX7hj0v.js → dist-oJho0qAp.js} +1 -1
  9. package/client/dist/assets/index-BitdwoH0.css +2 -0
  10. package/client/dist/assets/index-DpAqxRJ6.js +166 -0
  11. package/client/dist/assets/purify.es-DuRL7t6i.js +3 -0
  12. package/client/dist/assets/{react-9ZasmZpi.js → react-6C37rxNK.js} +1 -1
  13. package/client/dist/index.html +3 -3
  14. package/package.json +33 -33
  15. package/server/dist/controllers/configuration.controller.cjs +0 -1
  16. package/server/dist/controllers/configuration.controller.cjs.map +1 -1
  17. package/server/dist/controllers/configuration.controller.d.ts +0 -1
  18. package/server/dist/controllers/configuration.controller.mjs.map +1 -1
  19. package/server/dist/controllers/dictionary.controller.cjs +2 -3
  20. package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
  21. package/server/dist/controllers/dictionary.controller.d.ts +1 -2
  22. package/server/dist/controllers/dictionary.controller.mjs +1 -1
  23. package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
  24. package/server/dist/index.cjs.map +1 -1
  25. package/server/dist/index.d.ts +1 -1
  26. package/server/dist/index.mjs.map +1 -1
  27. package/server/dist/routes/config.routes.cjs +0 -1
  28. package/server/dist/routes/config.routes.cjs.map +1 -1
  29. package/server/dist/routes/config.routes.d.ts +0 -1
  30. package/server/dist/routes/config.routes.mjs.map +1 -1
  31. package/server/dist/routes/dictionary.routes.cjs +0 -1
  32. package/server/dist/routes/dictionary.routes.cjs.map +1 -1
  33. package/server/dist/routes/dictionary.routes.d.ts +0 -1
  34. package/server/dist/routes/dictionary.routes.mjs.map +1 -1
  35. package/server/dist/utils/checkPortAvailability.cjs.map +1 -1
  36. package/server/dist/utils/checkPortAvailability.mjs.map +1 -1
  37. package/server/dist/utils/httpStatusCodes.cjs.map +1 -1
  38. package/server/dist/utils/httpStatusCodes.d.ts +18 -18
  39. package/server/dist/utils/httpStatusCodes.mjs.map +1 -1
  40. package/server/dist/utils/responseData.cjs.map +1 -1
  41. package/server/dist/utils/responseData.d.ts +4 -25
  42. package/server/dist/utils/responseData.mjs.map +1 -1
  43. package/client/dist/assets/MarkDownRender-DYtR7ef3.js +0 -22
  44. package/client/dist/assets/MarkDownRender-DwR7eb6H.js +0 -1
  45. package/client/dist/assets/MarkdownEditor-D739xPU7.js +0 -474
  46. package/client/dist/assets/dist-vfGJhmSv.js +0 -12
  47. package/client/dist/assets/index-BF3NXAE_.css +0 -2
  48. package/client/dist/assets/index-C_PGdKGd.js +0 -166
  49. package/client/dist/assets/purify.es-DlxR2Lg_.js +0 -3
@@ -0,0 +1,3 @@
1
+ function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,i){return t(e)||n(e,i)||a(e,i)||r()}function a(t,n){if(t){if(typeof t==`string`)return e(t,n);var r={}.toString.call(t).slice(8,-1);return r===`Object`&&t.constructor&&(r=t.constructor.name),r===`Map`||r===`Set`?Array.from(t):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var o=Object.entries,s=Object.setPrototypeOf,c=Object.isFrozen,l=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,f=Object.seal,ee=Object.create,p=typeof Reflect<`u`&&Reflect,m=p.apply,te=p.construct;d||=function(e){return e},f||=function(e){return e},m||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},te||=function(e){return new e(...[...arguments].slice(1))};var h=w(Array.prototype.forEach),ne=w(Array.prototype.lastIndexOf),re=w(Array.prototype.pop),g=w(Array.prototype.push),ie=w(Array.prototype.splice),_=Array.isArray,ae=w(String.prototype.toLowerCase),oe=w(String.prototype.toString),se=w(String.prototype.match),ce=w(String.prototype.replace),le=w(String.prototype.indexOf),ue=w(String.prototype.trim),de=w(Number.prototype.toString),fe=w(Boolean.prototype.toString),v=typeof BigInt>`u`?null:w(BigInt.prototype.toString),y=typeof Symbol>`u`?null:w(Symbol.prototype.toString),b=w(Object.prototype.hasOwnProperty),x=w(Object.prototype.toString),S=w(RegExp.prototype.test),C=T(TypeError);function w(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return m(e,t,n)}}function T(e){return function(){return te(e,[...arguments])}}function E(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ae;if(s&&s(e,null),!_(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(c(t)||(t[r]=e),i=e)}e[i]=!0}return e}function D(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function O(e){let t=ee(null);for(let r of o(e)){var n=i(r,2);let a=n[0],o=n[1];b(e,a)&&(_(o)?t[a]=D(o):o&&typeof o==`object`&&o.constructor===Object?t[a]=O(o):t[a]=o)}return t}function pe(e){switch(typeof e){case`string`:return e;case`number`:return de(e);case`boolean`:return fe(e);case`bigint`:return v?v(e):`0`;case`symbol`:return y?y(e):`Symbol()`;case`undefined`:return x(e);case`function`:case`object`:{if(e===null)return x(e);let t=e,n=k(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:x(e)}return x(e)}default:return x(e)}}function k(e,t){for(;e!==null;){let n=u(e,t);if(n){if(n.get)return w(n.get);if(typeof n.value==`function`)return w(n.value)}e=l(e)}function n(){return null}return n}function me(e){try{return S(e,``),!0}catch{return!1}}var he=d(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ge=d(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),_e=d([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ve=d([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),ye=d(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),be=d([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),xe=d([`#text`]),Se=d(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ce=d(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),we=d(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Te=d([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ee=f(/{{[\w\W]*|^[\w\W]*}}/g),De=f(/<%[\w\W]*|^[\w\W]*%>/g),Oe=f(/\${[\w\W]*/g),ke=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ae=f(/^aria-[\-\w]+$/),je=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Me=f(/^(?:\w+script|data):/i),Ne=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pe=f(/^html$/i),Fe=f(/^[a-z][.\w]*(-[.\w]+)+$/i),Ie=f(/<[/\w!]/g),Le=f(/<[/\w]/g),Re=f(/<\/no(script|embed|frames)/i),ze=f(/\/>/i),A={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Be=function(){return typeof window>`u`?null:window},Ve=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},He=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(e,t,n,r){return b(e,t)&&_(e[t])?E(r.base?O(r.base):{},e[t],r.transform):n};function Ue(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Be(),t=e=>Ue(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==A.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,s=e.Node,c=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,p=e.trustedTypes,m=c.prototype,te=k(m,`cloneNode`),de=k(m,`remove`),fe=k(m,`nextSibling`),v=k(m,`childNodes`),y=k(m,`parentNode`),x=k(m,`shadowRoot`),w=k(m,`attributes`),T=s&&s.prototype?k(s.prototype,`nodeType`):null,D=s&&s.prototype?k(s.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let M,N=``,We,Ge=!1,Ke=0,qe=function(){if(Ke>0)throw C(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},P=function(e){qe(),Ke++;try{return M.createHTML(e)}finally{Ke--}},Je=function(e){qe(),Ke++;try{return M.createScriptURL(e)}finally{Ke--}},Ye=function(){return Ge||=(We=Ve(p,i),!0),We},Xe=n,Ze=Xe.implementation,Qe=Xe.createNodeIterator,$e=Xe.createDocumentFragment,et=Xe.getElementsByTagName,tt=r.importNode,F=He();t.isSupported=typeof o==`function`&&typeof y==`function`&&Ze&&Ze.createHTMLDocument!==void 0;let nt=Ee,rt=De,it=Oe,at=ke,ot=Ae,st=Me,ct=Ne,lt=Fe,ut=je,I=null,dt=E({},[...he,...ge,..._e,...ye,...xe]),L=null,ft=E({},[...Se,...Ce,...we,...Te]),R=Object.seal(ee(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),pt=null,mt=null,z=Object.seal(ee(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ht=!0,gt=!0,_t=!1,vt=!0,B=!1,V=!0,H=!1,yt=!1,bt=null,xt=null,St=!1,U=!1,Ct=!1,wt=!1,Tt=!0,Et=!1,Dt=`user-content-`,Ot=!0,kt=!1,W={},G=null,At=E({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),jt=null,Mt=E({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Nt=null,Pt=E({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ft=`http://www.w3.org/1998/Math/MathML`,It=`http://www.w3.org/2000/svg`,K=`http://www.w3.org/1999/xhtml`,q=K,Lt=!1,Rt=null,zt=E({},[Ft,It,K],oe),Bt=d([`mi`,`mo`,`mn`,`ms`,`mtext`]),Vt=E({},Bt),Ht=d([`annotation-xml`]),Ut=E({},Ht),Wt=E({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],J=null,Y=null,qt=n.createElement(`form`),Jt=function(e){return e instanceof RegExp||e instanceof Function},Yt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Y&&Y===e)return;(!e||typeof e!=`object`)&&(e={}),e=O(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Gt===`application/xhtml+xml`?oe:ae,I=j(e,`ALLOWED_TAGS`,dt,{transform:J}),L=j(e,`ALLOWED_ATTR`,ft,{transform:J}),Rt=j(e,`ALLOWED_NAMESPACES`,zt,{transform:oe}),Nt=j(e,`ADD_URI_SAFE_ATTR`,Pt,{transform:J,base:Pt}),jt=j(e,`ADD_DATA_URI_TAGS`,Mt,{transform:J,base:Mt}),G=j(e,`FORBID_CONTENTS`,At,{transform:J}),pt=j(e,`FORBID_TAGS`,O({}),{transform:J}),mt=j(e,`FORBID_ATTR`,O({}),{transform:J}),W=b(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?O(e.USE_PROFILES):e.USE_PROFILES:!1,ht=e.ALLOW_ARIA_ATTR!==!1,gt=e.ALLOW_DATA_ATTR!==!1,_t=e.ALLOW_UNKNOWN_PROTOCOLS||!1,vt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=e.SAFE_FOR_TEMPLATES||!1,V=e.SAFE_FOR_XML!==!1,H=e.WHOLE_DOCUMENT||!1,U=e.RETURN_DOM||!1,Ct=e.RETURN_DOM_FRAGMENT||!1,wt=e.RETURN_TRUSTED_TYPE||!1,St=e.FORCE_BODY||!1,Tt=e.SANITIZE_DOM!==!1,Et=e.SANITIZE_NAMED_PROPS||!1,Ot=e.KEEP_CONTENT!==!1,kt=e.IN_PLACE||!1,ut=me(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:je,q=typeof e.NAMESPACE==`string`?e.NAMESPACE:K,Vt=b(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?O(e.MATHML_TEXT_INTEGRATION_POINTS):E({},Bt),Ut=b(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?O(e.HTML_INTEGRATION_POINTS):E({},Ht);let t=b(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?O(e.CUSTOM_ELEMENT_HANDLING):ee(null);if(R=ee(null),b(t,`tagNameCheck`)&&Jt(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),b(t,`attributeNameCheck`)&&Jt(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),b(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),f(R),B&&(gt=!1),Ct&&(U=!0),W&&(I=E({},xe),L=ee(null),W.html===!0&&(E(I,he),E(L,Se)),W.svg===!0&&(E(I,ge),E(L,Ce),E(L,Te)),W.svgFilters===!0&&(E(I,_e),E(L,Ce),E(L,Te)),W.mathMl===!0&&(E(I,ye),E(L,we),E(L,Te))),z.tagCheck=null,z.attributeCheck=null,b(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?z.tagCheck=e.ADD_TAGS:_(e.ADD_TAGS)&&(I===dt&&(I=O(I)),E(I,e.ADD_TAGS,J))),b(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?z.attributeCheck=e.ADD_ATTR:_(e.ADD_ATTR)&&(L===ft&&(L=O(L)),E(L,e.ADD_ATTR,J))),b(e,`ADD_URI_SAFE_ATTR`)&&_(e.ADD_URI_SAFE_ATTR)&&E(Nt,e.ADD_URI_SAFE_ATTR,J),b(e,`FORBID_CONTENTS`)&&_(e.FORBID_CONTENTS)&&(G===At&&(G=O(G)),E(G,e.FORBID_CONTENTS,J)),b(e,`ADD_FORBID_CONTENTS`)&&_(e.ADD_FORBID_CONTENTS)&&(G===At&&(G=O(G)),E(G,e.ADD_FORBID_CONTENTS,J)),Ot&&(I[`#text`]=!0),H&&E(I,[`html`,`head`,`body`]),I.table&&(E(I,[`tbody`]),delete pt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=M;M=e.TRUSTED_TYPES_POLICY;try{N=P(``)}catch(e){throw M=t,e}}else e.TRUSTED_TYPES_POLICY===null?(M=void 0,N=``):(M===void 0&&(M=Ye()),M&&typeof N==`string`&&(N=P(``)));d&&d(e),Y=e},Xt=E({},[...ge,..._e,...ve]),Zt=E({},[...ye,...be]),Qt=function(e,t,n){return t.namespaceURI===K?e===`svg`:t.namespaceURI===Ft?e===`svg`&&(n===`annotation-xml`||Vt[n]):!!Xt[e]},$t=function(e,t,n){return t.namespaceURI===K?e===`math`:t.namespaceURI===It?e===`math`&&Ut[n]:!!Zt[e]},en=function(e,t,n){return t.namespaceURI===It&&!Ut[n]||t.namespaceURI===Ft&&!Vt[n]?!1:!Zt[e]&&(Wt[e]||!Xt[e])},tn=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:q,tagName:`template`});let n=ae(e.tagName),r=ae(t.tagName);return Rt[e.namespaceURI]?e.namespaceURI===It?Qt(n,t,r):e.namespaceURI===Ft?$t(n,t,r):e.namespaceURI===K?en(n,t,r):!!(Gt===`application/xhtml+xml`&&Rt[e.namespaceURI]):!1},X=function(e){g(t.removed,{element:e});try{y(e).removeChild(e)}catch{if(de(e),!y(e))throw C(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},nn=function(e){an(e);let t=v(e);if(t){let e=[];h(t,t=>{g(e,t)}),h(e,e=>{try{de(e)}catch{}})}let n=w(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},Z=function(e,n){try{g(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{g(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(U||Ct)try{X(n)}catch{}else try{n.setAttribute(e,``)}catch{}},rn=function(e){let t=w(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||L[J(i)]))try{e.removeAttribute(i)}catch{}}},an=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(T?T(e):e.nodeType)===A.element&&rn(e);let n=v(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},on=function(e){if(!V)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=T?T(e):e.nodeType;if(n===A.processingInstruction||n===A.comment&&S(Le,e.data)){try{de(e)}catch{}continue}if(n===A.element){let t=e,n=J(D?D(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=v(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},sn=function(e){let t=null,r=null;if(St)e=`<remove></remove>`+e;else{let t=se(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&q===K&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=M?P(e):e;if(q===K)try{t=new u().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=Ze.createDocument(q,`template`,null);try{t.documentElement.innerHTML=Lt?N:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),q===K?et.call(t,H?`html`:`body`)[0]:H?t.documentElement:a},cn=function(e){return Qe.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ln=function(e){return e=ce(e,nt,` `),e=ce(e,rt,` `),e=ce(e,it,` `),e},un=function(e){e.normalize();let t=Qe.call(e.ownerDocument||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=ln(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&h(r,e=>{Q(e.content)&&un(e.content)})},dn=function(e){let t=D?D(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==w(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==T(e)||e.childNodes!==v(e)},Q=function(e){if(!T||typeof e!=`object`||!e)return!1;try{return T(e)===A.documentFragment}catch{return!1}},fn=function(e){if(!T||typeof e!=`object`||!e)return!1;try{return typeof T(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&h(e,e=>{e.call(t,n,r,Y)})}let pn=function(e,t){return!!(V&&e.hasChildNodes()&&!fn(e.firstElementChild)&&S(Ie,e.textContent)&&S(Ie,e.innerHTML)||V&&e.namespaceURI===K&&t===`style`&&fn(e.firstElementChild)||e.nodeType===A.processingInstruction||V&&e.nodeType===A.comment&&S(Le,e.data))},mn=function(e,t){if(!pt[t]&&vn(t)&&(R.tagNameCheck instanceof RegExp&&S(R.tagNameCheck,t)||R.tagNameCheck instanceof Function&&R.tagNameCheck(t)))return!1;if(Ot&&!G[t]){let t=y(e),n=v(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=kt?n[i]:te(n[i],!0);t.insertBefore(r,fe(e))}}}return X(e),!0},hn=function(e,n){if($(F.beforeSanitizeElements,e,null),e!==n&&y(e)===null)return!0;if(dn(e))return X(e),!0;let r=J(D?D(e):e.nodeName);if($(F.uponSanitizeElement,e,{tagName:r,allowedTags:I}),e!==n&&y(e)===null)return!0;if(pn(e,r))return X(e),!0;if(pt[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!I[r]){let t=mn(e,r);return t===!1&&$(F.afterSanitizeElements,e,null),t}if((T?T(e):e.nodeType)===A.element&&!tn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&S(Re,e.innerHTML))return X(e),!0;if(B&&e.nodeType===A.text){let n=ln(e.textContent);e.textContent!==n&&(g(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(F.afterSanitizeElements,e,null),!1},gn=function(e,t,r){if(mt[t]||V&&t===`patchsrc`||V&&t===`for`&&e!==`label`&&e!==`output`||Tt&&(t===`id`||t===`name`)&&(r in n||r in qt))return!1;let i=L[t]||z.attributeCheck instanceof Function&&z.attributeCheck(t,e);if(!(gt&&S(at,t))&&!(ht&&S(ot,t))){if(!i){if(!(vn(e)&&(R.tagNameCheck instanceof RegExp&&S(R.tagNameCheck,e)||R.tagNameCheck instanceof Function&&R.tagNameCheck(e))&&(R.attributeNameCheck instanceof RegExp&&S(R.attributeNameCheck,t)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(t,e))||t===`is`&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&S(R.tagNameCheck,r)||R.tagNameCheck instanceof Function&&R.tagNameCheck(r))))return!1}else if(!Nt[t]&&!S(ut,ce(r,ct,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&le(r,`data:`)===0&&jt[e])&&!(_t&&!S(st,ce(r,ct,``)))&&r)return!1}return!0},_n=E({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),vn=function(e){return!_n[ae(e)]&&S(lt,e)},yn=function(e,t,n,r){if(M&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!n)switch(p.getAttributeType(e,t)){case`TrustedHTML`:return P(r);case`TrustedScriptURL`:return Je(r)}return r},bn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),dn(e)?X(e):re(t.removed)}catch{Z(n,e)}},xn=function(e){$(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||dn(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},r=t.length,i=J(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=J(o),u=c,d=o===`value`?u:ue(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,$(F.uponSanitizeAttribute,e,n),d=n.attrValue,Et&&(l===`id`||l===`name`)&&le(d,Dt)!==0&&(Z(o,e),d=Dt+d),V&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Z(o,e);continue}if(l===`attributename`&&se(d,`href`)){Z(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){Z(o,e);continue}if(!vt&&S(ze,d)){Z(o,e);continue}if(B&&(d=ln(d)),!gn(i,l,d)){Z(o,e);continue}d=yn(i,l,s,d),d!==u&&bn(e,o,s,d)}}$(F.afterSanitizeAttributes,e,null)},Sn=function(e){let t=null,n=cn(e);for($(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(F.uponSanitizeShadowNode,t,null),hn(t,e),xn(t),Q(t.content)&&Sn(t.content),(T?T(t):t.nodeType)===A.element){let e=x(t);Q(e)&&(Cn(e),Sn(e))}$(F.afterSanitizeShadowDOM,e,null)},Cn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Sn(e.shadow);continue}let n=e.node,r=(T?T(n):n.nodeType)===A.element,i=v(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=D?D(n):null;if(typeof e==`string`&&J(e)===`template`){let e=n.content;Q(e)&&t.push({node:e,shadow:null})}}if(r){let e=x(n);Q(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Lt=!e,Lt&&(e=`<!-->`),typeof e!=`string`&&!fn(e)&&(e=pe(e),typeof e!=`string`))throw C(`dirty is not a string, aborting`);if(!t.isSupported)return e;yt?(I=bt,L=xt):Yt(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(I=O(I)),F.uponSanitizeAttribute.length>0&&(L=O(L)),t.removed=[];let c=kt&&typeof e!=`string`&&fn(e);if(c){on(e);let t=D?D(e):e.nodeName;if(typeof t==`string`){let n=J(t);if(!I[n]||pt[n])throw nn(e),C(`root node is forbidden and cannot be sanitized in-place`)}if(dn(e))throw nn(e),C(`root node is clobbered and cannot be sanitized in-place`);try{Cn(e)}catch(t){throw nn(e),t}}else if(fn(e))i=sn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===A.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Cn(a);else{if(!U&&!B&&!H&&e.indexOf(`<`)===-1)return M&&wt?P(e):e;if(i=sn(e),!i)return U?null:wt?N:``}i&&St&&X(i.firstChild);let l=c?e:i,u=cn(l);try{for(;o=u.nextNode();)hn(o,l),xn(o),Q(o.content)&&Sn(o.content)}catch(n){throw c&&(nn(e),h(t.removed,e=>{e.element&&an(e.element)})),n}if(c)return h(t.removed,e=>{e.element&&an(e.element)}),B&&un(e),e;if(U){if(B&&un(i),Ct)for(s=$e.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=tt.call(r,s,!0)),s}let d=H?i.outerHTML:i.innerHTML;return H&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&S(Pe,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+d),B&&(d=ln(d)),M&&wt?P(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yt(e),yt=!0,bt=I,xt=L},t.clearConfig=function(){Y=null,yt=!1,bt=null,xt=null,M=We,N=``},t.isValidAttribute=function(e,t,n){Y||Yt({});let r=J(e),i=J(t);return gn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&b(F,e)&&g(F[e],t)},t.removeHook=function(e,t){if(b(F,e)){if(t!==void 0){let n=ne(F[e],t);return n===-1?void 0:ie(F[e],n,1)[0]}return re(F[e])}},t.removeHooks=function(e){b(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=He()},t}var M=Ue();export{M as default};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-CNC7AqOf.js";var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),n=e(((e,n)=>{n.exports=t()}));export{n as t};
1
+ import{t as e}from"./rolldown-runtime-CNC7AqOf.js";var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),n=e(((e,n)=>{n.exports=t()}));export{n as t};
@@ -5,10 +5,10 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Intlayer Editor</title>
8
- <script type="module" crossorigin src="/assets/index-C_PGdKGd.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DpAqxRJ6.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-CNC7AqOf.js">
10
- <link rel="modulepreload" crossorigin href="/assets/react-9ZasmZpi.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-BF3NXAE_.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/react-6C37rxNK.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-BitdwoH0.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-editor",
3
- "version": "9.0.0-canary.9",
3
+ "version": "9.0.0",
4
4
  "private": false,
5
5
  "description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
6
6
  "keywords": [
@@ -87,48 +87,48 @@
87
87
  "typecheck": "tsc --project ./server/tsconfig.types.json --noEmit"
88
88
  },
89
89
  "dependencies": {
90
- "@fastify/compress": "9.0.0",
91
- "@fastify/cookie": "11.0.2",
92
- "@fastify/cors": "11.2.0",
90
+ "@fastify/compress": "9.1.0",
91
+ "@fastify/cookie": "11.1.2",
92
+ "@fastify/cors": "11.3.0",
93
93
  "@fastify/formbody": "8.0.2",
94
- "@fastify/helmet": "13.0.2",
95
- "@fastify/static": "9.1.3",
96
- "@intlayer/chokidar": "9.0.0-canary.9",
97
- "@intlayer/config": "9.0.0-canary.9",
98
- "@intlayer/unmerged-dictionaries-entry": "9.0.0-canary.9",
99
- "fastify": "5.8.5",
100
- "fastify-intlayer": "9.0.0-canary.9",
94
+ "@fastify/helmet": "13.1.0",
95
+ "@fastify/static": "10.1.0",
96
+ "@intlayer/config": "9.0.0",
97
+ "@intlayer/engine": "9.0.0",
98
+ "@intlayer/unmerged-dictionaries-entry": "9.0.0",
99
+ "fastify": "5.10.0",
100
+ "fastify-intlayer": "9.0.0",
101
101
  "mime": "4.1.0"
102
102
  },
103
103
  "devDependencies": {
104
- "@intlayer/design-system": "9.0.0-canary.9",
105
- "@intlayer/editor-react": "9.0.0-canary.9",
106
- "@intlayer/types": "9.0.0-canary.9",
104
+ "@intlayer/design-system": "9.0.0",
105
+ "@intlayer/editor-react": "9.0.0",
106
+ "@intlayer/types": "9.0.0",
107
107
  "@rolldown/plugin-babel": "0.2.3",
108
- "@tailwindcss/vite": "4.3.1",
109
- "@tanstack/react-query": "5.101.1",
110
- "@types/node": "25.9.4",
108
+ "@tailwindcss/vite": "4.3.3",
109
+ "@tanstack/react-query": "5.101.4",
110
+ "@types/node": "26.1.1",
111
111
  "@types/react": "19.2.17",
112
112
  "@types/react-dom": "19.2.3",
113
113
  "@utils/ts-config": "1.0.4",
114
114
  "@vitejs/plugin-react": "6.0.3",
115
- "autoprefixer": "10.5.0",
115
+ "autoprefixer": "10.5.4",
116
116
  "babel-plugin-react-compiler": "1.0.0",
117
- "framer-motion": "12.41.0",
118
- "fuse.js": "7.4.2",
119
- "globals": "17.6.0",
120
- "intlayer": "9.0.0-canary.9",
121
- "lucide-react": "1.21.0",
122
- "react": "19.2.7",
123
- "react-dom": "19.2.7",
124
- "react-intlayer": "9.0.0-canary.9",
125
- "react-router-dom": "7.18.0",
126
- "tailwindcss": "4.3.1",
127
- "tsdown": "0.21.10",
128
- "typescript": "6.0.3",
129
- "vite": "8.1.0",
130
- "vite-intlayer": "9.0.0-canary.9",
131
- "vitest": "4.1.9"
117
+ "framer-motion": "12.42.2",
118
+ "fuse.js": "7.5.0",
119
+ "globals": "17.7.0",
120
+ "intlayer": "9.0.0",
121
+ "lucide-react": "1.25.0",
122
+ "react": "19.2.8",
123
+ "react-dom": "19.2.8",
124
+ "react-intlayer": "9.0.0",
125
+ "react-router-dom": "7.18.1",
126
+ "tailwindcss": "4.3.3",
127
+ "tsdown": "0.22.13",
128
+ "typescript": "7.0.2",
129
+ "vite": "8.1.5",
130
+ "vite-intlayer": "9.0.0",
131
+ "vitest": "4.1.10"
132
132
  },
133
133
  "engines": {
134
134
  "node": ">=18.0.0"
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_utils_responseData = require('../utils/responseData.cjs');
4
3
  let _intlayer_config_node = require("@intlayer/config/node");
5
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import { getConfiguration as getApplicationConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,mBAAmB,OAC9B,MACA,QACkB;AAClB,KAAI;EAGF,MAAM,oBAAoBA,0CAA+B,EACvD,mDAAY,EACb,CAAC;AAEF,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyBA,0CAA+B;GAC5D,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,SAAO,IAAI,KAAK,uBAAuB"}
1
+ {"version":3,"file":"configuration.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import { getConfiguration as getApplicationConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;AAUA,MAAa,mBAAmB,OAC9B,MACA,QACkB;CAClB,IAAI;EAGF,MAAM,oBAAoBA,0CAA+B,EACvD,kDAAW,EACb,CAAC;EAED,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,MAAM,yBAAyBA,0CAA+B;GAC5D,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAED,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF"}
@@ -1,7 +1,6 @@
1
1
  import { ResponseData } from "../utils/responseData.js";
2
2
  import { IntlayerConfig } from "@intlayer/types/config";
3
3
  import { FastifyReply, FastifyRequest } from "fastify";
4
-
5
4
  //#region src/controllers/configuration.controller.d.ts
6
5
  type GetConfigurationResult = ResponseData<IntlayerConfig>;
7
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.controller.mjs","names":["getApplicationConfiguration"],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import { getConfiguration as getApplicationConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;AAUA,MAAa,mBAAmB,OAC9B,MACA,QACkB;AAClB,KAAI;EAGF,MAAM,oBAAoB,eAA+B,EACvD,MAHaA,oBAGD,EACb,CAAC;AAEF,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyB,eAA+B;GAC5D,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,SAAO,IAAI,KAAK,uBAAuB"}
1
+ {"version":3,"file":"configuration.controller.mjs","names":["getApplicationConfiguration"],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import { getConfiguration as getApplicationConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;AAUA,MAAa,mBAAmB,OAC9B,MACA,QACkB;CAClB,IAAI;EAGF,MAAM,oBAAoB,eAA+B,EACvD,MAHaA,mBAGF,EACb,CAAC;EAED,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,MAAM,yBAAyB,eAA+B;GAC5D,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAED,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF"}
@@ -1,10 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_utils_responseData = require('../utils/responseData.cjs');
4
3
  let _intlayer_config_node = require("@intlayer/config/node");
5
4
  let node_path = require("node:path");
6
- let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
7
5
  let _intlayer_config_utils = require("@intlayer/config/utils");
6
+ let _intlayer_engine_build = require("@intlayer/engine/build");
8
7
  let _intlayer_unmerged_dictionaries_entry = require("@intlayer/unmerged-dictionaries-entry");
9
8
  let fastify_intlayer = require("fastify-intlayer");
10
9
 
@@ -39,7 +38,7 @@ const writeContentDeclaration = async (req, res) => {
39
38
  try {
40
39
  const dictionaryData = req.body.dictionary;
41
40
  const config = (0, _intlayer_config_node.getConfiguration)();
42
- const result = await (0, _intlayer_chokidar_build.writeContentDeclaration)(dictionaryData, config);
41
+ const result = await (0, _intlayer_engine_build.writeContentDeclaration)(dictionaryData, config);
43
42
  (0, _intlayer_config_utils.clearModuleCache)((0, node_path.join)(config.system.mainDir, `unmerged_dictionaries.cjs`));
44
43
  let description = "";
45
44
  switch (result.status) {
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import { join } from 'node:path';\nimport {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { clearModuleCache } from '@intlayer/config/utils';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n // Clear cache to hot reload the dictionaries\n const dictionariesPath = join(\n config.system.mainDir,\n `unmerged_dictionaries.cjs`\n );\n clearModuleCache(dictionariesPath);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAa,kBAAkB,OAC7B,MACA,QACkB;AAClB,KAAI;EACF,MAAM,oBAAoBA,0CAAqC,EAC7D,0EAA+B,EAChC,CAAC;AAEF,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyBA,0CAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,SAAO,IAAI,KAAK,uBAAuB;;;;;;AAe3C,MAAa,0BAA0B,OACrC,KACA,QACkB;AAClB,KAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAEhC,MAAM,sDAA2B;EAEjC,MAAM,SAAS,4DAAoC,gBAAgB,OAAO;AAO1E,mEAHE,OAAO,OAAO,SACd,4BAE+B,CAAC;EAElC,IAAI,cAAc;AAElB,UAAQ,OAAO,QAAf;GACE,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAGF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF;AACE,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;;EAIJ,MAAM,oBAAoBA,0CACxB;GACE,MAAM;GACN,iCAAW;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF;GACD,CACF;AAED,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;AAED,UAAQ,MAAM,aAAa;EAE3B,MAAM,yBACJA,0CAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEJ,SAAO,IAAI,KAAK,uBAAuB"}
1
+ {"version":3,"file":"dictionary.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { clearModuleCache } from '@intlayer/config/utils';\nimport {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/engine/build';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n // Clear cache to hot reload the dictionaries\n const dictionariesPath = join(\n config.system.mainDir,\n `unmerged_dictionaries.cjs`\n );\n clearModuleCache(dictionariesPath);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAqBA,MAAa,kBAAkB,OAC7B,MACA,QACkB;CAClB,IAAI;EACF,MAAM,oBAAoBA,0CAAqC,EAC7D,yEAA8B,EAChC,CAAC;EAED,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,MAAM,yBAAyBA,0CAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAED,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF;;;;AAaA,MAAa,0BAA0B,OACrC,KACA,QACkB;CAClB,IAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAEhC,MAAM,qDAA0B;EAEhC,MAAM,SAAS,0DAAoC,gBAAgB,MAAM;EAOzE,iEAHE,OAAO,OAAO,SACd,2BAE8B,CAAC;EAEjC,IAAI,cAAc;EAElB,QAAQ,OAAO,QAAf;GACE,KAAK;IACH,sCAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAGF,KAAK;IACH,sCAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAEF,KAAK;IACH,sCAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAEF,KAAK;IACH,sCAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAEF;IACE,sCAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;EAEJ;EAEA,MAAM,oBAAoBA,0CACxB;GACE,MAAM;GACN,iCAAW;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;GACD;EACF,CACF;EAEA,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,QAAQ,MAAM,YAAY;EAE1B,MAAM,yBACJA,0CAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAEH,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF"}
@@ -1,9 +1,8 @@
1
1
  import { ResponseData } from "../utils/responseData.js";
2
2
  import { FastifyReply, FastifyRequest } from "fastify";
3
- import { DictionaryStatus } from "@intlayer/chokidar/build";
3
+ import { DictionaryStatus } from "@intlayer/engine/build";
4
4
  import { Dictionary } from "@intlayer/types/dictionary";
5
5
  import { UnmergedDictionaries } from "@intlayer/unmerged-dictionaries-entry";
6
-
7
6
  //#region src/controllers/dictionary.controller.d.ts
8
7
  type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;
9
8
  /**
@@ -1,8 +1,8 @@
1
1
  import { formatResponse } from "../utils/responseData.mjs";
2
2
  import { getConfiguration } from "@intlayer/config/node";
3
3
  import { join } from "node:path";
4
- import { writeContentDeclaration as writeContentDeclaration$1 } from "@intlayer/chokidar/build";
5
4
  import { clearModuleCache } from "@intlayer/config/utils";
5
+ import { writeContentDeclaration as writeContentDeclaration$1 } from "@intlayer/engine/build";
6
6
  import { getUnmergedDictionaries } from "@intlayer/unmerged-dictionaries-entry";
7
7
  import { t } from "fastify-intlayer";
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.controller.mjs","names":["writeContentDeclarationEditor"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import { join } from 'node:path';\nimport {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { clearModuleCache } from '@intlayer/config/utils';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n // Clear cache to hot reload the dictionaries\n const dictionariesPath = join(\n config.system.mainDir,\n `unmerged_dictionaries.cjs`\n );\n clearModuleCache(dictionariesPath);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,kBAAkB,OAC7B,MACA,QACkB;AAClB,KAAI;EACF,MAAM,oBAAoB,eAAqC,EAC7D,MAAM,yBAAyB,EAChC,CAAC;AAEF,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyB,eAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,SAAO,IAAI,KAAK,uBAAuB;;;;;;AAe3C,MAAa,0BAA0B,OACrC,KACA,QACkB;AAClB,KAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAEhC,MAAM,SAAS,kBAAkB;EAEjC,MAAM,SAAS,MAAMA,0BAA8B,gBAAgB,OAAO;AAO1E,mBAJyB,KACvB,OAAO,OAAO,SACd,4BAE+B,CAAC;EAElC,IAAI,cAAc;AAElB,UAAQ,OAAO,QAAf;GACE,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAGF,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF;AACE,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;;EAIJ,MAAM,oBAAoB,eACxB;GACE,MAAM;GACN,SAAS,EAAE;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF;GACD,CACF;AAED,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;AAED,UAAQ,MAAM,aAAa;EAE3B,MAAM,yBACJ,eAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEJ,SAAO,IAAI,KAAK,uBAAuB"}
1
+ {"version":3,"file":"dictionary.controller.mjs","names":["writeContentDeclarationEditor"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { clearModuleCache } from '@intlayer/config/utils';\nimport {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/engine/build';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n // Clear cache to hot reload the dictionaries\n const dictionariesPath = join(\n config.system.mainDir,\n `unmerged_dictionaries.cjs`\n );\n clearModuleCache(dictionariesPath);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,kBAAkB,OAC7B,MACA,QACkB;CAClB,IAAI;EACF,MAAM,oBAAoB,eAAqC,EAC7D,MAAM,wBAAwB,EAChC,CAAC;EAED,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,MAAM,yBAAyB,eAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAED,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF;;;;AAaA,MAAa,0BAA0B,OACrC,KACA,QACkB;CAClB,IAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAEhC,MAAM,SAAS,iBAAiB;EAEhC,MAAM,SAAS,MAAMA,0BAA8B,gBAAgB,MAAM;EAOzE,iBAJyB,KACvB,OAAO,OAAO,SACd,2BAE8B,CAAC;EAEjC,IAAI,cAAc;EAElB,QAAQ,OAAO,QAAf;GACE,KAAK;IACH,cAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAGF,KAAK;IACH,cAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAEF,KAAK;IACH,cAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAEF,KAAK;IACH,cAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;GAEF;IACE,cAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;IACN,CAAC;IACD;EAEJ;EAEA,MAAM,oBAAoB,eACxB;GACE,MAAM;GACN,SAAS,EAAE;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;GACD;EACF,CACF;EAEA,OAAO,IAAI,KAAK,iBAAiB;CACnC,SAAS,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;EACV;EAEA,QAAQ,MAAM,YAAY;EAE1B,MAAM,yBACJ,eAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;GACT;GACA,QAAQ,aAAa,UAAU;EACjC,CAAC;EAEH,OAAO,IAAI,KAAK,sBAAsB;CACxC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["__dirname","ANSIColors","intlayer","checkPortAvailability","fastifyHelmet","fastifyCors","fastifyCompress","fastifyCookie","fastifyFormbody","dictionaryRouter","configurationRouter","fastifyStatic"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nif (!config.editor.enabled) {\n appLogger(\n `Editor is not enabled. Add ${colorize('editor.enabled', ANSIColors.BLUE)} to ${colorizePath('intlayer.config.ts')} file to enable it.`,\n {\n level: 'error',\n }\n );\n process.exit(0);\n}\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n disableRequestLogging: true, // Optional: Keep logs clean like the original\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n appLogger(`Error: Port ${port} is already in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: '0.0.0.0' });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (err) {\n app.log.error(err);\n process.exit(1);\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,+GAAkD,CAAC;AAEzD,MAAM,iBAAiB;CACrB,KAAK,QAAQ,IAAI;CACjB,SAAS,QAAQ,IAAI;CACtB;AAED,MAAM,gBAAgB;AACtB,MAAM,qDAA0B,eAAe;AAE/C,MAAM,sDAAyB,OAAO;AACtC,MAAM,OAAO,OAAO,OAAO,QAAQ;AAEnC,IAAI,CAAC,OAAO,OAAO,SAAS;AAC1B,WACE,oEAAuC,kBAAkBC,wBAAW,KAAK,CAAC,gDAAmB,qBAAqB,CAAC,sBACnH,EACE,OAAO,SACR,CACF;AACD,SAAQ,KAAK,EAAE;;AAIjB,MAAM,cAAc,KAAK,uDACFD,aAAW,qBAAqB,EAAE,OAAO,CAC/D;AAED,MAAM,2BAA+B,EACnC,uBAAuB,MACxB,CAAC;AAIF,IAAI,SAASE,0BAAS;AAEtB,MAAM,wCAAyBF,aAAW,oBAAoB;AAE9D,MAAM,cAAkC;CACtC,QAAQ;CACR,aAAa;CACd;AAED,MAAM,cAAc,OAAO,QAAyB;AAGlD,KAAI,CAAC,MAFyBG,0DAAsB,KAAK,EAEnC;AACpB,YAAU,eAAe,KAAK,sBAAsB,EAClD,OAAO,SACR,CAAC;AACF,UAAQ,KAAK,IAAI;;AAInB,OAAM,IAAI,SAASC,yBAAe;EAChC,uBAAuB;EACvB,QAAQ;EACT,CAAC;AAGF,OAAM,IAAI,SAASC,uBAAa,YAAY;AAG5C,OAAM,IAAI,SAASC,0BAAgB;AAGnC,OAAM,IAAI,SAASC,wBAAc;AAGjC,OAAM,IAAI,SAASC,0BAAgB;AAGnC,OAAM,IAAI,SAASC,mDAAkB,EAAE,QAAQ,mBAAmB,CAAC;AACnE,OAAM,IAAI,SAASC,kDAAqB,EAAE,QAAQ,eAAe,CAAC;AAGlE,OAAM,IAAI,SAASC,yBAAe;EAChC,MAAM;EACN,UAAU;EACX,CAAC;AAGF,KAAI,oBAAoB,KAAK,UAAU;EACrC,MAAM,oCAAqB,gBAAgB,IAAI,IAAI,OAAO,IAAI;AAE9D,8BAAe,cAAc,2BAAc,cAAc,CAAC,QAAQ,EAAE;GAClE,MAAM,WACJ,aAAK,QAAQ,cAAc,IAAI;AACjC,SAAM,OAAO,gBAAgB,SAAS;AACtC,UAAO,MAAM,SAAS,IAAI,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,IAAI,aAAa;QAEpE,QAAO,MAAM,SAAS,aAAa;GAErC;AAEF,KAAI;AACF,QAAM,IAAI,OAAO;GAAE;GAAM,MAAM;GAAW,CAAC;EAE3C,MAAM,0DACJ,eAAe,KACf,eAAe,QAChB;AAED,UAAQ,IAAI;kFACQ,YAAYV,wBAAW,KAAK,EAAEA,wBAAW,UAAU,CAAC,yCAAY,IAAI,YAAY,WAAWA,wBAAW,UAAU,CAAC;;6EAEzF,oBAAoB,OAAO,CAAC;4CAC7D,KAAKA,wBAAW,UAAU,CAAC,8BAA8B,OAAO,OAAO,mBAAmB,KAAK,gDAAmB,OAAO,OAAO,eAAe,CAAC;4CAChJ,KAAKA,wBAAW,UAAU,CAAC,8BAA8B,OAAO,OAAO,YAAY,IAAI;4CACvF,KAAKA,wBAAW,UAAU,CAAC,8BAA8B,kBAAkB,IAAI;MACxF;UACK,KAAK;AACZ,MAAI,IAAI,MAAM,IAAI;AAClB,UAAQ,KAAK,EAAE;;;AAKnB,YAAY,IAAI"}
1
+ {"version":3,"file":"index.cjs","names":["__dirname","ANSIColors","intlayer","checkPortAvailability","fastifyHelmet","fastifyCors","fastifyCompress","fastifyCookie","fastifyFormbody","dictionaryRouter","configurationRouter","fastifyStatic"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nif (!config.editor.enabled) {\n appLogger(\n `Editor is not enabled. Add ${colorize('editor.enabled', ANSIColors.BLUE)} to ${colorizePath('intlayer.config.ts')} file to enable it.`,\n {\n level: 'error',\n }\n );\n process.exit(0);\n}\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n disableRequestLogging: true, // Optional: Keep logs clean like the original\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n appLogger(`Error: Port ${port} is already in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: '0.0.0.0' });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (err) {\n app.log.error(err);\n process.exit(1);\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,8GAAiD,CAAC;AAExD,MAAM,iBAAiB;CACrB,KAAK,QAAQ,IAAI;CACjB,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,gBAAgB;AACtB,MAAM,qDAA0B,cAAc;AAE9C,MAAM,sDAAyB,MAAM;AACrC,MAAM,OAAO,OAAO,OAAO,QAAQ;AAEnC,IAAI,CAAC,OAAO,OAAO,SAAS;CAC1B,UACE,oEAAuC,kBAAkBC,wBAAW,IAAI,EAAE,gDAAmB,oBAAoB,EAAE,sBACnH,EACE,OAAO,QACT,CACF;CACA,QAAQ,KAAK,CAAC;AAChB;AAGA,MAAM,cAAc,KAAK,uDACFD,aAAW,oBAAoB,GAAG,MAAM,CAC/D;AAEA,MAAM,2BAA+B,EACnC,uBAAuB,KACzB,CAAC;AAID,IAAI,SAASE,yBAAQ;AAErB,MAAM,wCAAyBF,aAAW,mBAAmB;AAE7D,MAAM,cAAkC;CACtC,QAAQ;CACR,aAAa;AACf;AAEA,MAAM,cAAc,OAAO,QAAyB;CAGlD,IAAI,CAAC,MAFyBG,0DAAsB,IAAI,GAElC;EACpB,UAAU,eAAe,KAAK,sBAAsB,EAClD,OAAO,QACT,CAAC;EACD,QAAQ,KAAK,GAAG;CAClB;CAGA,MAAM,IAAI,SAASC,yBAAe;EAChC,uBAAuB;EACvB,QAAQ;CACV,CAAC;CAGD,MAAM,IAAI,SAASC,uBAAa,WAAW;CAG3C,MAAM,IAAI,SAASC,yBAAe;CAGlC,MAAM,IAAI,SAASC,uBAAa;CAGhC,MAAM,IAAI,SAASC,yBAAe;CAGlC,MAAM,IAAI,SAASC,mDAAkB,EAAE,QAAQ,kBAAkB,CAAC;CAClE,MAAM,IAAI,SAASC,kDAAqB,EAAE,QAAQ,cAAc,CAAC;CAGjE,MAAM,IAAI,SAASC,yBAAe;EAChC,MAAM;EACN,UAAU;CACZ,CAAC;CAGD,IAAI,oBAAoB,KAAK,UAAU;EACrC,MAAM,oCAAqB,gBAAgB,IAAI,IAAI,OAAO,GAAG;EAE7D,4BAAe,aAAa,4BAAe,aAAa,CAAC,CAAC,OAAO,GAAG;GAClE,MAAM,WACJ,aAAK,QAAQ,aAAa,KAAK;GACjC,MAAM,OAAO,gBAAgB,QAAQ;GACrC,OAAO,MAAM,SAAS,IAAI,IAAI,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,YAAY;EACrE,OACE,OAAO,MAAM,SAAS,YAAY;CAEtC,CAAC;CAED,IAAI;EACF,MAAM,IAAI,OAAO;GAAE;GAAM,MAAM;EAAU,CAAC;EAE1C,MAAM,0DACJ,eAAe,KACf,eAAe,OACjB;EAEA,QAAQ,IAAI;kFACQ,YAAYV,wBAAW,IAAI,GAAGA,wBAAW,SAAS,EAAE,yCAAY,IAAI,YAAY,WAAWA,wBAAW,SAAS,EAAE;;6EAEzF,oBAAoB,MAAM,EAAE;4CAC7D,KAAKA,wBAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,mBAAmB,KAAK,gDAAmB,OAAO,OAAO,cAAc,EAAE;4CAChJ,KAAKA,wBAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,YAAY,IAAI;4CACvF,KAAKA,wBAAW,SAAS,EAAE,8BAA8B,kBAAkB,IAAI;KACzF;CACH,SAAS,KAAK;EACZ,IAAI,IAAI,MAAM,GAAG;EACjB,QAAQ,KAAK,CAAC;CAChB;AACF;AAGA,YAAY,GAAG"}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nif (!config.editor.enabled) {\n appLogger(\n `Editor is not enabled. Add ${colorize('editor.enabled', ANSIColors.BLUE)} to ${colorizePath('intlayer.config.ts')} file to enable it.`,\n {\n level: 'error',\n }\n );\n process.exit(0);\n}\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n disableRequestLogging: true, // Optional: Keep logs clean like the original\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n appLogger(`Error: Port ${port} is already in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: '0.0.0.0' });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (err) {\n app.log.error(err);\n process.exit(1);\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAEzD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;CACtB;AAED,MAAM,gBAAgB;AACtB,MAAM,SAAS,iBAAiB,eAAe;AAE/C,MAAM,YAAY,aAAa,OAAO;AACtC,MAAM,OAAO,OAAO,OAAO,QAAQ;AAEnC,IAAI,CAAC,OAAO,OAAO,SAAS;AAC1B,WACE,8BAA8B,SAAS,kBAAkB,WAAW,KAAK,CAAC,MAAM,aAAa,qBAAqB,CAAC,sBACnH,EACE,OAAO,SACR,CACF;AACD,SAAQ,KAAK,EAAE;;AAIjB,MAAM,cAAc,KAAK,MACvB,aAAa,QAAQ,WAAW,qBAAqB,EAAE,OAAO,CAC/D;AAED,MAAM,MAAuB,QAAQ,EACnC,uBAAuB,MACxB,CAAC;AAIF,IAAI,SAAS,SAAS;AAEtB,MAAM,iBAAiB,QAAQ,WAAW,oBAAoB;AAE9D,MAAM,cAAkC;CACtC,QAAQ;CACR,aAAa;CACd;AAED,MAAM,cAAc,OAAO,QAAyB;AAGlD,KAAI,CAAC,MAFyB,sBAAsB,KAAK,EAEnC;AACpB,YAAU,eAAe,KAAK,sBAAsB,EAClD,OAAO,SACR,CAAC;AACF,UAAQ,KAAK,IAAI;;AAInB,OAAM,IAAI,SAAS,eAAe;EAChC,uBAAuB;EACvB,QAAQ;EACT,CAAC;AAGF,OAAM,IAAI,SAAS,aAAa,YAAY;AAG5C,OAAM,IAAI,SAAS,gBAAgB;AAGnC,OAAM,IAAI,SAAS,cAAc;AAGjC,OAAM,IAAI,SAAS,gBAAgB;AAGnC,OAAM,IAAI,SAAS,kBAAkB,EAAE,QAAQ,mBAAmB,CAAC;AACnE,OAAM,IAAI,SAAS,qBAAqB,EAAE,QAAQ,eAAe,CAAC;AAGlE,OAAM,IAAI,SAAS,eAAe;EAChC,MAAM;EACN,UAAU;EACX,CAAC;AAGF,KAAI,oBAAoB,KAAK,UAAU;EACrC,MAAM,gBAAgB,KAAK,gBAAgB,IAAI,IAAI,OAAO,IAAI;AAE9D,MAAI,WAAW,cAAc,IAAI,UAAU,cAAc,CAAC,QAAQ,EAAE;GAClE,MAAM,WACJ,KAAK,QAAQ,cAAc,IAAI;AACjC,SAAM,OAAO,gBAAgB,SAAS;AACtC,UAAO,MAAM,SAAS,IAAI,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,IAAI,aAAa;QAEpE,QAAO,MAAM,SAAS,aAAa;GAErC;AAEF,KAAI;AACF,QAAM,IAAI,OAAO;GAAE;GAAM,MAAM;GAAW,CAAC;EAE3C,MAAM,iBAAiB,eACrB,eAAe,KACf,eAAe,QAChB;AAED,UAAQ,IAAI;MACV,SAAS,SAAS,YAAY,WAAW,KAAK,EAAE,WAAW,UAAU,CAAC,GAAG,SAAS,IAAI,YAAY,WAAW,WAAW,UAAU,CAAC;;mCAEtG,aAAa,oBAAoB,OAAO,CAAC;MACtE,SAAS,KAAK,WAAW,UAAU,CAAC,8BAA8B,OAAO,OAAO,mBAAmB,KAAK,MAAM,aAAa,OAAO,OAAO,eAAe,CAAC;MACzJ,SAAS,KAAK,WAAW,UAAU,CAAC,8BAA8B,OAAO,OAAO,YAAY,IAAI;MAChG,SAAS,KAAK,WAAW,UAAU,CAAC,8BAA8B,kBAAkB,IAAI;MACxF;UACK,KAAK;AACZ,MAAI,IAAI,MAAM,IAAI;AAClB,UAAQ,KAAK,EAAE;;;AAKnB,YAAY,IAAI"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { colorize, colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\n\nconst appLogger = getAppLogger(config);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nif (!config.editor.enabled) {\n appLogger(\n `Editor is not enabled. Add ${colorize('editor.enabled', ANSIColors.BLUE)} to ${colorizePath('intlayer.config.ts')} file to enable it.`,\n {\n level: 'error',\n }\n );\n process.exit(0);\n}\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n disableRequestLogging: true, // Optional: Keep logs clean like the original\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n appLogger(`Error: Port ${port} is already in use.`, {\n level: 'error',\n });\n process.exit(255);\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: '0.0.0.0' });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (err) {\n app.log.error(err);\n process.exit(1);\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC;AAExD,MAAM,iBAAiB;CACrB;CACA,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,gBAAgB;AACtB,MAAM,SAAS,iBAAiB,cAAc;AAE9C,MAAM,YAAY,aAAa,MAAM;AACrC,MAAM,OAAO,OAAO,OAAO,QAAQ;AAEnC,IAAI,CAAC,OAAO,OAAO,SAAS;CAC1B,UACE,8BAA8B,SAAS,kBAAkB,WAAW,IAAI,EAAE,MAAM,aAAa,oBAAoB,EAAE,sBACnH,EACE,OAAO,QACT,CACF;CACA,QAAQ,KAAK,CAAC;AAChB;AAGA,MAAM,cAAc,KAAK,MACvB,aAAa,QAAQ,WAAW,oBAAoB,GAAG,MAAM,CAC/D;AAEA,MAAM,MAAuB,QAAQ,EACnC,uBAAuB,KACzB,CAAC;AAID,IAAI,SAAS,QAAQ;AAErB,MAAM,iBAAiB,QAAQ,WAAW,mBAAmB;AAE7D,MAAM,cAAkC;CACtC,QAAQ;CACR,aAAa;AACf;AAEA,MAAM,cAAc,OAAO,QAAyB;CAGlD,IAAI,CAAC,MAFyB,sBAAsB,IAAI,GAElC;EACpB,UAAU,eAAe,KAAK,sBAAsB,EAClD,OAAO,QACT,CAAC;EACD,QAAQ,KAAK,GAAG;CAClB;CAGA,MAAM,IAAI,SAAS,eAAe;EAChC,uBAAuB;EACvB,QAAQ;CACV,CAAC;CAGD,MAAM,IAAI,SAAS,aAAa,WAAW;CAG3C,MAAM,IAAI,SAAS,eAAe;CAGlC,MAAM,IAAI,SAAS,aAAa;CAGhC,MAAM,IAAI,SAAS,eAAe;CAGlC,MAAM,IAAI,SAAS,kBAAkB,EAAE,QAAQ,kBAAkB,CAAC;CAClE,MAAM,IAAI,SAAS,qBAAqB,EAAE,QAAQ,cAAc,CAAC;CAGjE,MAAM,IAAI,SAAS,eAAe;EAChC,MAAM;EACN,UAAU;CACZ,CAAC;CAGD,IAAI,oBAAoB,KAAK,UAAU;EACrC,MAAM,gBAAgB,KAAK,gBAAgB,IAAI,IAAI,OAAO,GAAG;EAE7D,IAAI,WAAW,aAAa,KAAK,UAAU,aAAa,CAAC,CAAC,OAAO,GAAG;GAClE,MAAM,WACJ,KAAK,QAAQ,aAAa,KAAK;GACjC,MAAM,OAAO,gBAAgB,QAAQ;GACrC,OAAO,MAAM,SAAS,IAAI,IAAI,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,YAAY;EACrE,OACE,OAAO,MAAM,SAAS,YAAY;CAEtC,CAAC;CAED,IAAI;EACF,MAAM,IAAI,OAAO;GAAE;GAAM,MAAM;EAAU,CAAC;EAE1C,MAAM,iBAAiB,eACrB,eAAe,KACf,eAAe,OACjB;EAEA,QAAQ,IAAI;MACV,SAAS,SAAS,YAAY,WAAW,IAAI,GAAG,WAAW,SAAS,EAAE,GAAG,SAAS,IAAI,YAAY,WAAW,WAAW,SAAS,EAAE;;mCAEtG,aAAa,oBAAoB,MAAM,EAAE;MACtE,SAAS,KAAK,WAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,mBAAmB,KAAK,MAAM,aAAa,OAAO,OAAO,cAAc,EAAE;MACzJ,SAAS,KAAK,WAAW,SAAS,EAAE,8BAA8B,OAAO,OAAO,YAAY,IAAI;MAChG,SAAS,KAAK,WAAW,SAAS,EAAE,8BAA8B,kBAAkB,IAAI;KACzF;CACH,SAAS,KAAK;EACZ,IAAI,IAAI,MAAM,GAAG;EACjB,QAAQ,KAAK,CAAC;CAChB;AACF;AAGA,YAAY,GAAG"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_controllers_configuration_controller = require('../controllers/configuration.controller.cjs');
4
3
  let _intlayer_config_node = require("@intlayer/config/node");
5
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.routes.cjs","names":[],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":";;;;;;AAKA,MAAM,EAAE,wDAA6B;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,gCACV,EACC,kBAAkB;CAChB,UAAU;CACV,KAAK,YAAY;CACjB,QAAQ;CACT,EACF;AAEH,MAAa,sBAAsB,OAAO,YAA6B;AACrE,SAAQ,IACN,wBAAwB,CAAC,iBAAiB,wEAE3C"}
1
+ {"version":3,"file":"config.routes.cjs","names":[],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,uDAA4B;AAEpC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,gCACV,EACC,kBAAkB;CAChB,UAAU;CACV,KAAK,WAAW;CAChB,QAAQ;AACV,EACF;AAEF,MAAa,sBAAsB,OAAO,YAA6B;CACrE,QAAQ,IACN,uBAAuB,CAAC,CAAC,iBAAiB,uEAE5C;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { FastifyInstance } from "fastify";
2
-
3
2
  //#region src/routes/config.routes.d.ts
4
3
  declare const getConfigurationRoutes: () => {
5
4
  getConfiguration: {
@@ -1 +1 @@
1
- {"version":3,"file":"config.routes.mjs","names":["configurationController.getConfiguration"],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":";;;;AAKA,MAAM,EAAE,WAAW,kBAAkB;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,gCACV,EACC,kBAAkB;CAChB,UAAU;CACV,KAAK,YAAY;CACjB,QAAQ;CACT,EACF;AAEH,MAAa,sBAAsB,OAAO,YAA6B;AACrE,SAAQ,IACN,wBAAwB,CAAC,iBAAiB,UAC1CA,mBACD"}
1
+ {"version":3,"file":"config.routes.mjs","names":["configurationController.getConfiguration"],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":";;;;AAKA,MAAM,EAAE,WAAW,iBAAiB;AAEpC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,gCACV,EACC,kBAAkB;CAChB,UAAU;CACV,KAAK,WAAW;CAChB,QAAQ;AACV,EACF;AAEF,MAAa,sBAAsB,OAAO,YAA6B;CACrE,QAAQ,IACN,uBAAuB,CAAC,CAAC,iBAAiB,UAC1CA,kBACF;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_controllers_dictionary_controller = require('../controllers/dictionary.controller.cjs');
4
3
  let _intlayer_config_node = require("@intlayer/config/node");
5
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.routes.cjs","names":["getDictionaries","writeContentDeclaration"],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":";;;;;;AAQA,MAAM,EAAE,wDAA6B;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,6BACV;CACC,iBAAiB;EACf,UAAU;EACV,KAAK,YAAY;EACjB,QAAQ;EACT;CACD,yBAAyB;EACvB,UAAU;EACV,KAAK,YAAY;EACjB,QAAQ;EACT;CACF;AAEH,MAAa,mBAAmB,OAAO,YAA6B;AAClE,SAAQ,IAAI,qBAAqB,CAAC,gBAAgB,UAAUA,0DAAgB;AAC5E,SAAQ,KACN,qBAAqB,CAAC,wBAAwB,UAC9CC,kEACD"}
1
+ {"version":3,"file":"dictionary.routes.cjs","names":["getDictionaries","writeContentDeclaration"],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":";;;;;AAQA,MAAM,EAAE,uDAA4B;AAEpC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,6BACV;CACC,iBAAiB;EACf,UAAU;EACV,KAAK,WAAW;EAChB,QAAQ;CACV;CACA,yBAAyB;EACvB,UAAU;EACV,KAAK,WAAW;EAChB,QAAQ;CACV;AACF;AAEF,MAAa,mBAAmB,OAAO,YAA6B;CAClE,QAAQ,IAAI,oBAAoB,CAAC,CAAC,gBAAgB,UAAUA,yDAAe;CAC3E,QAAQ,KACN,oBAAoB,CAAC,CAAC,wBAAwB,UAC9CC,iEACF;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { FastifyInstance } from "fastify";
2
-
3
2
  //#region src/routes/dictionary.routes.d.ts
4
3
  declare const getDictionaryRoutes: () => {
5
4
  getDictionaries: {
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.routes.mjs","names":[],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":";;;;AAQA,MAAM,EAAE,WAAW,kBAAkB;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,6BACV;CACC,iBAAiB;EACf,UAAU;EACV,KAAK,YAAY;EACjB,QAAQ;EACT;CACD,yBAAyB;EACvB,UAAU;EACV,KAAK,YAAY;EACjB,QAAQ;EACT;CACF;AAEH,MAAa,mBAAmB,OAAO,YAA6B;AAClE,SAAQ,IAAI,qBAAqB,CAAC,gBAAgB,UAAU,gBAAgB;AAC5E,SAAQ,KACN,qBAAqB,CAAC,wBAAwB,UAC9C,wBACD"}
1
+ {"version":3,"file":"dictionary.routes.mjs","names":[],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":";;;;AAQA,MAAM,EAAE,WAAW,iBAAiB;AAEpC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,6BACV;CACC,iBAAiB;EACf,UAAU;EACV,KAAK,WAAW;EAChB,QAAQ;CACV;CACA,yBAAyB;EACvB,UAAU;EACV,KAAK,WAAW;EAChB,QAAQ;CACV;AACF;AAEF,MAAa,mBAAmB,OAAO,YAA6B;CAClE,QAAQ,IAAI,oBAAoB,CAAC,CAAC,gBAAgB,UAAU,eAAe;CAC3E,QAAQ,KACN,oBAAoB,CAAC,CAAC,wBAAwB,UAC9C,uBACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkPortAvailability.cjs","names":["net"],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":";;;;;;AAEA,MAAa,yBAAyB,SAAmC;AACvE,QAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAASA,iBAAI,cAAc;AAEjC,SAAO,KAAK,UAAU,QAAa;AACjC,OAAI,IAAI,SAAS,aACf,SAAQ,MAAM;OAEd,SAAQ,KAAK;IAEf;AAEF,SAAO,KAAK,mBAAmB;AAC7B,UAAO,OAAO;AACd,WAAQ,KAAK;IACb;AAEF,SAAO,OAAO,KAAK;GACnB"}
1
+ {"version":3,"file":"checkPortAvailability.cjs","names":["net"],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":";;;;;;AAEA,MAAa,yBAAyB,SAAmC;CACvE,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAASA,iBAAI,aAAa;EAEhC,OAAO,KAAK,UAAU,QAAa;GACjC,IAAI,IAAI,SAAS,cACf,QAAQ,KAAK;QAEb,QAAQ,IAAI;EAEhB,CAAC;EAED,OAAO,KAAK,mBAAmB;GAC7B,OAAO,MAAM;GACb,QAAQ,IAAI;EACd,CAAC;EAED,OAAO,OAAO,IAAI;CACpB,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkPortAvailability.mjs","names":[],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":";;;AAEA,MAAa,yBAAyB,SAAmC;AACvE,QAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAAS,IAAI,cAAc;AAEjC,SAAO,KAAK,UAAU,QAAa;AACjC,OAAI,IAAI,SAAS,aACf,SAAQ,MAAM;OAEd,SAAQ,KAAK;IAEf;AAEF,SAAO,KAAK,mBAAmB;AAC7B,UAAO,OAAO;AACd,WAAQ,KAAK;IACb;AAEF,SAAO,OAAO,KAAK;GACnB"}
1
+ {"version":3,"file":"checkPortAvailability.mjs","names":[],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":";;;AAEA,MAAa,yBAAyB,SAAmC;CACvE,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAAS,IAAI,aAAa;EAEhC,OAAO,KAAK,UAAU,QAAa;GACjC,IAAI,IAAI,SAAS,cACf,QAAQ,KAAK;QAEb,QAAQ,IAAI;EAEhB,CAAC;EAED,OAAO,KAAK,mBAAmB;GAC7B,OAAO,MAAM;GACb,QAAQ,IAAI;EACd,CAAC;EAED,OAAO,OAAO,IAAI;CACpB,CAAC;AACH"}