1import{a as i,j as t}from"./x-BhSU7twD.js";import{a as C}from"./anburizer-BuMOkaeC.js";import{g as L,e as S,u as E,S as H}from"./main-Lqr5XvFe.js";import{F as T}from"./XMarkIcon-CJ3KQkMF.js";function z({title:s,titleId:c,...l},x){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:x,"aria-labelledby":c},l),s?i.createElement("title",{id:c},s):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"}))}const M=i.forwardRef(z);function R(s){const c="дзлнÑÑбвгкмпÑÑÑ
ÑÑÑ",l="ÄźľÅÅÅ¥bvgkmprfhcÄÅ¡",x="иеÑÑÑÑ",b="ieoua'",f={й:"j",Ñ:"c",Ñ:"u",к:"k",е:"je",н:"n",г:"g",Ñ:"Å¡",Ñ:"šš",з:"z",Ñ
:"h",Ñ:"f",Ñ:"y",в:"v",а:"a",п:"p",Ñ:"r",о:"o",л:"l",д:"d",ж:"ž",Ñ:"e",Ñ:"ja",Ñ:"Ä",Ñ:"s",м:"m",и:"i",Ñ:"t",б:"b",Ñ:"ju",Ñ:"jo",Ó§:"ö",Ñ:"i"};let p="";for(let u=0;u<s.length;u++){let e=s[u],h=!1;const n=u<s.length-1?s[u+1]:void 0,d=u>0?s[u-1].toLowerCase():void 0;if(!(e==="Ñ"||e==="Ñ")){if(e===e.toUpperCase()&&e!==e.toLowerCase()&&(h=!0,e=e.toLowerCase()),e==="Ñ"&&d==="Ñ")p=p.slice(0,-1),e="Ä";else if(e==="з"&&d==="д")e="ź";else{if(n&&c.includes(e)&&x.includes(n.toLowerCase())){const r=c.indexOf(e);e=l[r]}if(d&&x.includes(e)&&c.includes(d)&&e!=="Ñ"){const r=x.indexOf(e);e=b[r]}f[e]&&(e=f[e])}h&&(n&&n===n.toUpperCase()&&n!==n.toLowerCase()?e=e.toUpperCase():e=e.charAt(0).toUpperCase()+e.slice(1)),p+=e}}return p}const _=()=>{const s=L(),c=S(),[l,x]=i.useState(""),[b,f]=i.useState(""),[p,u]=i.useState(!1),[e,h]=i.useState(null),n=i.useRef(null),d=i.useRef(null),r=E();i.useEffect(()=>{const m=new URLSearchParams(s.search).get("mode");if(m&&(m==="latin"||m==="anbur"))h(m);else try{const o=localStorage.getItem("converterMode");if(o&&(o==="latin"||o==="anbur")){h(o);const v=new URLSearchParams(s.search);v.set("mode",o);const y=v.toString(),N=s.pathname+(y?`?${y}`:"");c(N,{replace:!0})}else h("latin")}catch(o){console.warn("Failed to load converter mode from localStorage:",o),h("latin")}},[s.search,s.pathname,c]),i.useEffect(()=>{if(e===null)return;const a=new URLSearchParams(s.search);if(a.get("mode")!==e){a.set("mode",e);const o=a.toString(),v=s.pathname+(o?`?${o}`:"");c(v,{replace:!0})}try{localStorage.setItem("converterMode",e)}catch(o){console.warn("Failed to save converter mode to localStorage:",o)}},[e,s.search,s.pathname,c]),i.useEffect(()=>{if(e===null)return;const a=setTimeout(()=>{l.trim()?f(e==="latin"?R(l):C(l)):f("")},300);return()=>clearTimeout(a)},[l,e]),i.useEffect(()=>{if(n.current){n.current.style.height="auto";const a=n.current.scrollHeight,o=Math.max(200,a);n.current.style.height=`${o}px`,d.current&&window.innerWidth>=1024&&(d.current.style.minHeight=`${o}px`)}},[l]),i.useEffect(()=>{const a=()=>{if(n.current&&d.current)if(window.innerWidth>=1024){const m=n.current.offsetHeight;d.current.style.minHeight=`${Math.max(200,m)}px`}else d.current.style.minHeight="200px"};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const k=async()=>{if(b)try{await navigator.clipboard.writeText(b),u(!0),setTimeout(()=>u(!1),2e3)}catch(a){console.error("Failed to copy text: ",a)}},j=()=>{x(""),f("")},w="ÐзоÑидзалӧ бобӧнÑнÑ",g=e==="latin"?{title:r.converters.info.latinTitle,description:r.converters.info.latinDescription,outputLabel:r.converters.sections.latinOutput,info:r.converters.info.latinFeatures,link:"https://vk.com/wall563259045_51"}:{title:r.converters.info.anburTitle,description:r.converters.info.anburDescription,outputLabel:r.converters.sections.anburOutput,info:r.converters.info.anburFeatures,link:"https://t.me/komi_anbur/7"};return e===null?null:t.jsxs(t.Fragment,{children:[t.jsx(H,{title:`${r.converters.title} - majbyr.com`,description:r.converters.subtitle,keywords:"converter, cyrillic, latin, anbur, old permic, transliteration, komi"}),t.jsx("div",{className:"pt-25 min-h-screen bg-gray-50 dark:bg-gray-900 py-8",children:t.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:r.converters.title}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 max-w-2xl mx-auto mb-6",children:r.converters.subtitle}),t.jsx("div",{className:"flex justify-center mb-8",children:t.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-1 shadow-lg",children:[t.jsx("button",{onClick:()=>
1h("latin"),className:`px-6 py-3 rounded-md text-sm font-medium transition-all ${e==="latin"?"bg-blue-600 dark:bg-blue-700 text-white shadow-md":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"}`,children:r.converters.modes.latin}),t.jsx("button",{onClick:()=>h("anbur"),className:`px-6 py-3 rounded-md text-sm font-medium transition-all ${e==="anbur"?"bg-blue-600 dark:bg-blue-700 text-white shadow-md":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white"}`,children:r.converters.modes.anbur})]})})]}),t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg overflow-hidden",children:t.jsxs("div",{className:"flex flex-col lg:flex-row",children:[t.jsxs("div",{className:"flex-1 p-6 border-b lg:border-b-0 lg:border-r border-gray-200 dark:border-gray-700",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4 min-h-[40px]",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:r.converters.sections.input}),t.jsx("div",{className:"flex items-center",children:l&&t.jsxs("button",{onClick:j,className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors",children:[t.jsx(T,{className:"w-4 h-4"}),r.converters.actions.clear]})})]}),t.jsx("textarea",{ref:n,value:l,onChange:a=>x(a.target.value),placeholder:r.converters.placeholders.inputText,className:"majbyr-field w-full min-h-[200px] p-4 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none resize-none overflow-hidden font-sans",style:{height:"auto",fontFamily:"Noto Sans, ui-sans-serif, system-ui, sans-serif"}}),!l&&t.jsx("div",{className:"mt-4",children:t.jsxs("button",{onClick:()=>x(w),className:"text-sm text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors",children:[r.converters.actions.tryExample,': "',w,'"']})})]}),t.jsxs("div",{className:"flex-1 p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4 min-h-[40px]",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:g.outputLabel}),t.jsx("div",{className:"flex items-center",children:b&&t.jsxs("button",{onClick:k,className:"flex items-center gap-2 px-3 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors text-sm",children:[t.jsx(M,{className:"w-4 h-4"}),p?r.converters.actions.copied:r.converters.actions.copy]})})]}),t.jsx("div",{ref:d,className:`w-full min-h-[200px] p-4 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white whitespace-pre-wrap break-words ${e==="anbur"?"anbur-text":"font-sans"}`,style:{fontFamily:e==="anbur"?"Noto Sans Old Permic, ui-sans-serif, system-ui, sans-serif":"Noto Sans, ui-sans-serif, system-ui, sans-serif"},children:b||t.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:g.outputLabel.toLowerCase()})})]})]})}),t.jsxs("div",{className:"mt-8 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-6",children:[t.jsx("h3",{className:"text-lg font-semibold text-blue-900 dark:text-blue-100 mb-3",children:g.title}),t.jsx("p",{className:"text-blue-800 dark:text-blue-200 mb-4 text-sm",children:g.description}),t.jsx("div",{className:"text-blue-800 dark:text-blue-200 space-y-2 text-sm",children:g.info.map((a,m)=>t.jsx("p",{children:a},m))}),t.jsx("div",{className:"mt-4 pt-4 border-t border-blue-200 dark:border-blue-700",children:t.jsxs("a",{href:g.link,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors font-medium",children:[r.projects.learnMore,t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})})]})]})})]})};export{_ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.