const ne={count:":chars characters · :px / :max px",good:"Good length",emptyTitle:"Empty: the title template is used",emptyDescription:"Empty: the template or the excerpt is used",shortTitle:"Short: aim for 30–60 characters",shortDescription:"Short: aim for 120–160 characters",longTitle:"Too long: Google cuts titles after about 580 px",longDescription:"Too long: Google cuts descriptions after about 920 px on desktop and 680 px on mobile",indexing:"Indexing",links:"Links",inherit:"Inherit",siteDefault:"Site default",index:"Index",noindex:"Noindex",follow:"Follow",nofollow:"Nofollow",advanced:"Advanced directives",advancedSet:{one:":count set",other:":count set"},maxSnippet:"Maximum snippet length (characters)",maxSnippetHint:"Empty: no limit. 0: no snippet. -1: no limit.",maxImagePreview:"Image preview size",notSet:"Not set",none:"None",standard:"Standard",large:"Large",maxVideoPreview:"Maximum video preview (seconds)",noarchive:"Do not show a cached copy (noarchive)",nosnippet:"Do not show a snippet (nosnippet)",noimageindex:"Do not index images (noimageindex)",unavailableAfter:"Remove from results after",invalidNumber:"Enter a whole number, -1 or more.",robotsUnparsed:"The stored value “:value” is not one this editor can show. It stays as it is until you reset it.",robotsReset:"Reset",desktop:"Desktop",mobile:"Mobile",device:"Preview device",language:"Language: :locale",fromTemplate:"Title from the template “:template”",fromContent:"Description from the content excerpt",noDescription:"No description: Google picks text from the page.",noUrl:"The address appears after the first save.",savedNote:"The address and the H1 come from the saved record. Save to refresh them.",checking:"Checking for duplicates…",dupTitle:{one:"Same title as :count other page: :list",other:"Same title as :count other pages: :list"},dupDescription:{one:"Same description as :count other page: :list",other:"Same description as :count other pages: :list"},andMore:"and :count more",keyphrase:"Focus keyphrase “:phrase”",kpTitle:"In the SEO title",kpTitleNo:"Not in the SEO title",kpH1:"In the H1",kpH1No:"Not in the H1",kpDesc:"In the meta description",kpDescNo:"Not in the meta description",kpUrl:"In the address",kpUrlNo:"Not in the address",kpLength:"Text length: :count words",kpLengthNo:"Text length: :count words, aim for at least 300",contextFailed:"The preview data could not be loaded.",imageUpload:"Upload image",imageReplace:"Replace image",imageRemove:"Remove",imageUploading:"Uploading…",imageFailed:"The image could not be uploaded.",imageAlt:"Social image preview",size:":size of 500 KB",clean:"No problems found.",unknown:"Line :line: “:word” is not a robots.txt directive.",unknownSuggest:"Line :line: “:word” is not a robots.txt directive. Did you mean “:suggestion”?",noGroup:"Line :line: this rule has no User-agent line above it, so crawlers ignore it.",badPath:"Line :line: a path must start with / or *.",noColon:"Line :line: write the directive as “Name: value”.",ownSitemap:"Line :line: Sitemap lines are added automatically. This one is kept as written.",crawlDelay:"Line :line: Google ignores Crawl-delay. Bing and Yandex use it.",moreFindings:"and :count more",tooLarge:"Over 500 KB: the file cannot be saved.",url:"Address",urlPlaceholder:"/konto/ustawienia",agent:"Crawler",allowedRule:"Allowed for :agent. Rule: line :line “:rule”.",allowedNone:"Allowed for :agent: no rule matches this address.",blocked:"Blocked for :agent by line :line “:rule”.",blockedBot:"Blocked for :agent by its switch on the AI bots tab.",unsaved:"Tests the text in the editor and the AI bot switches, including unsaved changes.",stagingNote:"On this environment every address is blocked. The result shows the production behaviour.",urlRequired:"Enter an address starting with /.",testFailed:"The test could not be run. Try again.",exportHeading:"Export",importHeading:"Import",dataset:"Data",dsRedirects:"Redirects",dsRules:"URL rules",dsRecords:"SEO of records",download:"Download CSV",chooseFile:"Choose CSV file",noFile:"No file chosen",summary:":new new, :changed changed, :unchanged unchanged, :refused refused",bNew:"New",bChanged:"Changed",bUnchanged:"Unchanged",bRefused:"Refused",bWarning:"Warning",colLine:"Line",colChange:"Change",colAddress:"Address",colField:"Field",colBefore:"Before",colAfter:"After",colNote:"Note",rowCap:"Showing the first 200 of :count rows. All rows are applied.",refusedBlocks:"Fix the refused rows in the file and preview it again. Nothing is applied while a row is refused.",nothing:"The file changes nothing.",discard:"Discard preview",fileTooLarge:"This file is larger than :limit. Split it into smaller files, or import it through MCP.",readFailed:"The file could not be read.",openHistory:"Open History",applyCount:{one:"Apply :count change",other:"Apply :count changes"},schemaType:"Schema type",typeDefault:"Default (:type)",tBlogPosting:"BlogPosting (blog post)",tArticle:"Article (article)",tNewsArticle:"NewsArticle (news)",tWebPage:"WebPage (page)",tAboutPage:"AboutPage (about us)",tContactPage:"ContactPage (contact)",tService:"Service (service or offer)",tCollectionPage:"CollectionPage (listing)",tProfilePage:"ProfilePage (profile)",noteArticle:"Author, dates, image, word count and section come from the content.",notePage:"Name, description and breadcrumbs come from the SEO tab.",noteContact:"Address and opening hours come from the SEO settings (Publisher, Local business).",noteService:"The provider is the publisher from the SEO settings.",noteCollection:"Lists the items shown on the page.",noteProfile:"Name, image and profiles come from the author.",serviceType:"Kind of service",serviceTypePh:"e.g. Mushroom workshops",areaServed:"Area served",areaServedHint:"Cities or regions, separated by commas.",price:"Price",priceHint:"Leave empty when the price is set individually.",currency:"Currency",currencyHint:"ISO code, e.g. PLN.",priceInvalid:"Enter a price such as 150 or 149.99.",currencyInvalid:"Use a three-letter currency code, e.g. PLN.",custom:"Custom JSON-LD (advanced)",customSet:"Set",customHint:"An object or a list of objects. A node with the @id of a generated node is merged into it, and your values win; other nodes are added to the graph. Paste only the JSON, without a script tag.",jsonValid:{one:"Valid JSON: :count node",other:"Valid JSON: :count nodes"},jsonError:"Line :line, column :column: :message",jsonNotObject:"Use an object or a list of objects.",jsonTooLarge:"Over 16 KB: shorten the custom JSON-LD.",forLocale:"JSON-LD for :locale — :url",graphChecking:"Building the graph…",allGood:"No problems: every node has its required and recommended properties.",required:"Missing required property “:property” (:type)",recommended:"Missing recommended property “:property” (:type)",noRules:":type has no rich-result rules at Google; it is checked as valid schema.org only.",showJson:"Show JSON-LD",hideJson:"Hide JSON-LD",richResults:"Check in Google's Rich Results Test",graphNoUrl:"The Rich Results Test link appears after the first save, when the page has an address.",graphUnsaved:"Shows the saved page with your unsaved structured data changes.",layerNodes:"The site may add nodes of its own, such as FAQPage. The site audit checks the rendered result.",graphAction:"Check structured data",graphFailed:"The structured data could not be built. Try again.",linksInbound:"Links to this page",linksOutbound:"Links from this page",linksCrawled:"From the crawl of :time.",linksNotCrawled:"Link counts appear after the first crawl (SEO › Site audit).",linksOrphanTitle:"No page links here",linksOrphanText:"Search engines and visitors may not find this page. Link to it from one of the pages below.",linksOut:"Pages you could link to from this text",linksIn:"Pages that could link here",linksPhrase:"“:phrase” → :title",linksCopy:"Copy address",linksCopied:"Address copied.",linksNone:"No suggestions. They come from titles and focus keyphrases found in the saved text.",linksNoRecord:"Suggestions appear after the first save.",linksChecking:"Loading the internal links…",linksFailed:"The internal links could not be loaded. Try again.",primaryDefault:"Default (first category)"},de={count:"Znaki: :chars · :px / :max px",good:"Dobra długość",emptyTitle:"Puste: używany jest szablon tytułu",emptyDescription:"Puste: używany jest szablon lub zajawka",shortTitle:"Krótki: celuj w 30–60 znaków",shortDescription:"Krótki: celuj w 120–160 znaków",longTitle:"Za długi: Google ucina tytuły po ok. 580 px",longDescription:"Za długi: Google ucina opisy po ok. 920 px na komputerze i 680 px na telefonie",indexing:"Indeksowanie",links:"Linki",inherit:"Dziedzicz",siteDefault:"Domyślne",index:"Indeksuj",noindex:"Nie indeksuj",follow:"Śledź",nofollow:"Nie śledź",advanced:"Dyrektywy zaawansowane",advancedSet:{one:"ustawiona :count",few:"ustawione :count",many:"ustawionych :count",other:"ustawione :count"},maxSnippet:"Maksymalna długość fragmentu (znaki)",maxSnippetHint:"Puste: bez limitu. 0: bez fragmentu. -1: bez limitu.",maxImagePreview:"Rozmiar podglądu obrazu",notSet:"Nie ustawiono",none:"Brak",standard:"Standardowy",large:"Duży",maxVideoPreview:"Maksymalny podgląd wideo (sekundy)",noarchive:"Nie pokazuj kopii (noarchive)",nosnippet:"Nie pokazuj fragmentu (nosnippet)",noimageindex:"Nie indeksuj obrazów (noimageindex)",unavailableAfter:"Usuń z wyników po dniu",invalidNumber:"Wpisz liczbę całkowitą, -1 lub większą.",robotsUnparsed:"Zapisanej wartości „:value” ten edytor nie potrafi pokazać. Zostaje bez zmian, dopóki jej nie wyzerujesz.",robotsReset:"Wyzeruj",desktop:"Komputer",mobile:"Telefon",device:"Urządzenie podglądu",language:"Język: :locale",fromTemplate:"Tytuł z szablonu „:template”",fromContent:"Opis z zajawki treści",noDescription:"Brak opisu: Google wybierze tekst ze strony.",noUrl:"Adres pojawi się po pierwszym zapisie.",savedNote:"Adres i H1 pochodzą z zapisanego rekordu. Zapisz, aby je odświeżyć.",checking:"Sprawdzanie duplikatów…",dupTitle:{one:"Ten sam tytuł co :count inna strona: :list",few:"Ten sam tytuł co :count inne strony: :list",many:"Ten sam tytuł co :count innych stron: :list",other:"Ten sam tytuł co :count innej strony: :list"},dupDescription:{one:"Ten sam opis co :count inna strona: :list",few:"Ten sam opis co :count inne strony: :list",many:"Ten sam opis co :count innych stron: :list",other:"Ten sam opis co :count innej strony: :list"},andMore:"i :count więcej",keyphrase:"Fraza kluczowa „:phrase”",kpTitle:"W tytule SEO",kpTitleNo:"Brak w tytule SEO",kpH1:"W nagłówku H1",kpH1No:"Brak w nagłówku H1",kpDesc:"W opisie meta",kpDescNo:"Brak w opisie meta",kpUrl:"W adresie",kpUrlNo:"Brak w adresie",kpLength:"Długość tekstu: :count słów",kpLengthNo:"Długość tekstu: :count słów, celuj w co najmniej 300",contextFailed:"Nie udało się wczytać danych podglądu.",imageUpload:"Wgraj obraz",imageReplace:"Zmień obraz",imageRemove:"Usuń",imageUploading:"Wgrywanie…",imageFailed:"Nie udało się wgrać obrazu.",imageAlt:"Podgląd obrazu w mediach społecznościowych",size:":size z 500 KB",clean:"Nie znaleziono problemów.",unknown:"Wiersz :line: „:word” nie jest dyrektywą robots.txt.",unknownSuggest:"Wiersz :line: „:word” nie jest dyrektywą robots.txt. Czy chodziło o „:suggestion”?",noGroup:"Wiersz :line: nad tą regułą nie ma wiersza User-agent, więc roboty ją ignorują.",badPath:"Wiersz :line: ścieżka musi zaczynać się od / lub *.",noColon:"Wiersz :line: zapisz dyrektywę jako „Nazwa: wartość”.",ownSitemap:"Wiersz :line: wiersze Sitemap są dodawane automatycznie. Ten zostaje bez zmian.",crawlDelay:"Wiersz :line: Google ignoruje Crawl-delay. Bing i Yandex go stosują.",moreFindings:"i :count więcej",tooLarge:"Ponad 500 KB: nie można zapisać pliku.",url:"Adres",urlPlaceholder:"/konto/ustawienia",agent:"Robot",allowedRule:"Dozwolone dla :agent. Reguła: wiersz :line „:rule”.",allowedNone:"Dozwolone dla :agent: żadna reguła nie pasuje do tego adresu.",blocked:"Zablokowane dla :agent przez wiersz :line „:rule”.",blockedBot:"Zablokowane dla :agent przełącznikiem w zakładce Boty AI.",unsaved:"Sprawdza tekst w edytorze i przełączniki botów AI, także niezapisane zmiany.",stagingNote:"W tym środowisku każdy adres jest zablokowany. Wynik pokazuje zachowanie na produkcji.",urlRequired:"Wpisz adres zaczynający się od /.",testFailed:"Nie udało się uruchomić testu. Spróbuj ponownie.",exportHeading:"Eksport",importHeading:"Import",dataset:"Dane",dsRedirects:"Przekierowania",dsRules:"Reguły adresów",dsRecords:"SEO rekordów",download:"Pobierz CSV",chooseFile:"Wybierz plik CSV",noFile:"Nie wybrano pliku",summary:"Nowe: :new, zmienione: :changed, bez zmian: :unchanged, odrzucone: :refused",bNew:"Nowy",bChanged:"Zmieniony",bUnchanged:"Bez zmian",bRefused:"Odrzucony",bWarning:"Ostrzeżenie",colLine:"Wiersz",colChange:"Zmiana",colAddress:"Adres",colField:"Pole",colBefore:"Przed",colAfter:"Po",colNote:"Uwagi",rowCap:"Pokazano pierwsze 200 z :count wierszy. Zastosowane zostaną wszystkie.",refusedBlocks:"Popraw odrzucone wiersze w pliku i ponownie wyświetl podgląd. Nic nie zostanie zastosowane, dopóki jakiś wiersz jest odrzucony.",nothing:"Plik niczego nie zmienia.",discard:"Odrzuć podgląd",fileTooLarge:"Ten plik jest większy niż :limit. Podziel go na mniejsze pliki lub zaimportuj przez MCP.",readFailed:"Nie udało się odczytać pliku.",openHistory:"Otwórz Historię zmian",applyCount:{one:"Zastosuj :count zmianę",few:"Zastosuj :count zmiany",many:"Zastosuj :count zmian",other:"Zastosuj :count zmiany"},schemaType:"Typ schema",typeDefault:"Domyślny (:type)",tBlogPosting:"BlogPosting (wpis na blogu)",tArticle:"Article (artykuł)",tNewsArticle:"NewsArticle (wiadomość)",tWebPage:"WebPage (strona)",tAboutPage:"AboutPage (o nas)",tContactPage:"ContactPage (kontakt)",tService:"Service (usługa lub oferta)",tCollectionPage:"CollectionPage (lista)",tProfilePage:"ProfilePage (profil)",noteArticle:"Autor, daty, obraz, liczba słów i sekcja pochodzą z treści.",notePage:"Nazwa, opis i ścieżka nawigacji pochodzą z zakładki SEO.",noteContact:"Adres i godziny otwarcia pochodzą z ustawień SEO (Wydawca, Firma lokalna).",noteService:"Usługodawcą jest wydawca z ustawień SEO.",noteCollection:"Wymienia elementy pokazane na stronie.",noteProfile:"Imię i nazwisko, zdjęcie i profile pochodzą od autora.",serviceType:"Rodzaj usługi",serviceTypePh:"np. warsztaty grzybowe",areaServed:"Obszar działania",areaServedHint:"Miasta lub regiony oddzielone przecinkami.",price:"Cena",priceHint:"Zostaw puste, gdy cena jest ustalana indywidualnie.",currency:"Waluta",currencyHint:"Kod ISO, np. PLN.",priceInvalid:"Wpisz cenę, np. 150 lub 149,99.",currencyInvalid:"Użyj trzyliterowego kodu waluty, np. PLN.",custom:"Własny JSON-LD (zaawansowane)",customSet:"Ustawiony",customHint:"Obiekt lub lista obiektów. Węzeł z @id wygenerowanego węzła zostaje z nim scalony, a Twoje wartości mają pierwszeństwo; pozostałe węzły są dodawane do grafu. Wklej sam JSON, bez znacznika script.",jsonValid:{one:"Poprawny JSON: :count węzeł",few:"Poprawny JSON: :count węzły",many:"Poprawny JSON: :count węzłów",other:"Poprawny JSON: :count węzła"},jsonError:"Wiersz :line, kolumna :column: :message",jsonNotObject:"Użyj obiektu lub listy obiektów.",jsonTooLarge:"Ponad 16 KB: skróć własny JSON-LD.",forLocale:"JSON-LD dla :locale — :url",graphChecking:"Budowanie grafu…",allGood:"Brak problemów: każdy węzeł ma wymagane i zalecane właściwości.",required:"Brak wymaganej właściwości „:property” (:type)",recommended:"Brak zalecanej właściwości „:property” (:type)",noRules:":type nie ma reguł wyników z elementami rozszerzonymi w Google; sprawdzana jest tylko poprawność schema.org.",showJson:"Pokaż JSON-LD",hideJson:"Ukryj JSON-LD",richResults:"Sprawdź w Teście wyników z elementami rozszerzonymi Google",graphNoUrl:"Link do testu pojawi się po pierwszym zapisie, gdy strona będzie miała adres.",graphUnsaved:"Pokazuje zapisaną stronę z niezapisanymi zmianami danych strukturalnych.",layerNodes:"Witryna może dodać własne węzły, np. FAQPage. Audyt witryny sprawdza wynik na stronie.",graphAction:"Sprawdź dane strukturalne",graphFailed:"Nie udało się zbudować danych strukturalnych. Spróbuj ponownie.",linksInbound:"Linki do tej strony",linksOutbound:"Linki z tej strony",linksCrawled:"Według skanowania z :time.",linksNotCrawled:"Liczby linków pojawią się po pierwszym skanowaniu (SEO › Audyt witryny).",linksOrphanTitle:"Żadna strona tu nie linkuje",linksOrphanText:"Wyszukiwarki i odwiedzający mogą nie znaleźć tej strony. Dodaj do niej link z jednej ze stron poniżej.",linksOut:"Strony, do których możesz dodać link w tym tekście",linksIn:"Strony, które mogą tu linkować",linksPhrase:"„:phrase” → :title",linksCopy:"Kopiuj adres",linksCopied:"Skopiowano adres.",linksNone:"Brak propozycji. Powstają z tytułów i fraz kluczowych znalezionych w zapisanym tekście.",linksNoRecord:"Propozycje pojawią się po pierwszym zapisie.",linksChecking:"Wczytywanie linków wewnętrznych…",linksFailed:"Nie udało się wczytać linków wewnętrznych. Spróbuj ponownie.",primaryDefault:"Domyślna (pierwsza kategoria)"},ue={en:ne,pl:de};function v(n){return(n.getAttribute("ui-locale")||document.documentElement.lang||"en").toLowerCase().split(/[-_]/)[0]||"en"}function L(n){return ue[n]??ne}function y(n,e={}){const t=Object.keys(e).sort((o,r)=>r.length-o.length);let s=n;for(const o of t)s=s.split(":"+o).join(String(e[o]));return s}function I(n,e,t,s={}){let o="other";try{o=new Intl.PluralRules(t).select(e)}catch{o=e===1?"one":"other"}const r=o==="one"&&n.one||o==="few"&&n.few||o==="many"&&n.many||n.other;return y(r,{...s,count:new Intl.NumberFormat(t).format(e)})}function S(n,e){try{return new Intl.NumberFormat(e).format(n)}catch{return String(n)}}const J="http://www.w3.org/2000/svg",he={info:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 16v-4","M12 8h.01"],"triangle-alert":["m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3","M12 9v4","M12 17h.01"],"circle-check":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m9 12 2 2 4-4"],"circle-alert":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 8v4","M12 16h.01"],"chevron-down":["m6 9 6 6 6-6"],"external-link":["M15 3h6v6","M10 14 21 3","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"]};function k(n,e=14){const t=document.createElementNS(J,"svg");t.setAttribute("width",String(e)),t.setAttribute("height",String(e)),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true"),t.setAttribute("class","seo-icon seo-icon--"+n);for(const s of he[n]??[]){const o=document.createElementNS(J,"path");o.setAttribute("d",s),t.appendChild(o)}return t}function i(n,e="",t){const s=document.createElement(n);return e&&(s.className=e),t!==void 0&&(s.textContent=t),s}function P(n,e,t){const s=n.getAttribute(e);if(s===null||s==="")return t;try{return JSON.parse(s)}catch{return t}}function N(n,e,t){n.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}let K=0;function T(n){return K+=1,`${n}-${K}`}class F{constructor(e,t){this.host=e,this.onDropped=t}host;onDropped;inflight=null;queued=null;retry=null;retried=!1;timer;get current(){return this.inflight}request(e){if(this.host.hasAttribute("busy")||this.inflight!==null){this.queued=e;return}this.send(e)}settle(){const e=this.inflight;return this.inflight=null,this.flush(),e}flush(){if(this.host.hasAttribute("busy")||this.inflight!==null)return;const e=this.retry??this.queued;e!==null&&(this.retry!==null?this.retry=null:this.queued=null,this.send(e))}reset(){clearTimeout(this.timer),this.timer=void 0,this.inflight=null,this.retry=null,this.retried=!1}send(e){if(this.inflight=e,N(this.host,"summer-action",{payload:e}),this.host.hasAttribute("busy")||this.inflight!==e){this.retried=!1;return}if(this.inflight=null,this.retried){this.retried=!1,this.onDropped(e);return}this.retried=!0,this.retry=e,clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},0)}}const vt="golem15-seo-graph";function pe(n){return"https://search.google.com/test/rich-results?url="+encodeURIComponent(n)}function me(n){const e=n.indexOf("#");return e>=0?n.slice(e):n}class fe extends HTMLElement{static observedAttributes=["fill-values","busy","state","ui-locale","disabled","label"];data=null;failed=!1;pending=!1;showJSON=!1;shownLocale="";lastFill="";timer;connected=!1;actions=new F(this,()=>this.fail());onResult=e=>{const t=e.detail;this.actions.settle();const s=t?.data;s&&Array.isArray(s.nodes)&&(this.data=s,this.failed=!1),this.pending=this.actions.current!==null,this.render()};onLocale=e=>{const t=e.detail;typeof t=="string"&&t!==""&&t!==this.shownLocale&&(this.shownLocale=t,this.check())};connectedCallback(){this.connected=!0,this.lastFill=this.getAttribute("fill-values")??"",this.addEventListener("summer-result",this.onResult),window.addEventListener("summer:ml-locale",this.onLocale),this.render(),queueMicrotask(()=>{this.connected&&this.check()})}disconnectedCallback(){this.connected=!1,this.removeEventListener("summer-result",this.onResult),window.removeEventListener("summer:ml-locale",this.onLocale),clearTimeout(this.timer),this.actions.reset(),this.pending=!1}attributeChangedCallback(e,t,s){if(this.connected){if(e==="busy"&&s===null){this.actions.flush();return}if(e==="state"&&s==="error"){this.actions.settle()&&this.fail();return}if(e==="fill-values"){const o=s??"";o!==this.lastFill&&(this.lastFill=o,clearTimeout(this.timer),this.timer=setTimeout(()=>this.check(),800));return}this.render()}}labels(){return L(v(this))}check(){clearTimeout(this.timer),this.pending=!0,this.actions.request({op:"graph",locale:this.shownLocale}),this.render()}fail(){this.failed=!0,this.pending=this.actions.current!==null,this.render()}render(){if(!this.connected)return;const e=this.labels(),t=[];this.setAttribute("aria-busy",String(this.pending));const s=this.data,o=i("p","seo-graph__meta");if(s&&(o.textContent=s.url?y(e.forLocale,{locale:(s.locale||"").toUpperCase(),url:s.url}):e.graphNoUrl),this.pending){const r=i("p","seo-graph__meta seo-graph__checking",e.graphChecking);r.setAttribute("role","status"),t.push(r)}if(s){t.push(o);const r=i("div","seo-graph__nodes");let a=0;for(const l of s.nodes){const d=i("div","seo-graph__node"),u=i("div","seo-graph__node-head");u.append(i("span","seo-graph__pill",l.type||"—"),i("code","seo-graph__id",me(l.id||""))),d.append(u),l.rules||d.append(i("p","seo-graph__meta",y(e.noRules,{type:l.type})));for(const h of l.findings??[]){a++;const m=h.level==="required",b=i("p","seo-graph__finding seo-graph__finding--"+(m?"required":"recommended"));b.append(k(m?"circle-alert":"triangle-alert"),i("span","",y(m?e.required:e.recommended,{property:h.property,type:l.type}))),d.append(b)}r.append(d)}if(t.push(r),a===0&&s.nodes.length>0){const l=i("p","seo-graph__ok");l.append(k("circle-check"),i("span","",e.allGood)),t.push(l)}if(s.graph){const l=i("button","seo-graph__disclosure");l.type="button",l.setAttribute("aria-expanded",String(this.showJSON)),l.append(i("span","",this.showJSON?e.hideJson:e.showJson),k("chevron-down")),l.addEventListener("click",()=>{this.showJSON=!this.showJSON,this.render()}),t.push(l),this.showJSON&&t.push(i("pre","seo-graph__json",JSON.stringify(s.graph,null,2)))}const c=i("div","seo-graph__links");if(s.url){const l=i("a","seo-graph__link");l.href=pe(s.url),l.target="_blank",l.rel="noopener",l.append(i("span","",e.richResults),k("external-link")),c.append(l)}c.append(i("p","seo-graph__meta",e.graphUnsaved),i("p","seo-graph__meta",e.layerNodes)),t.push(c)}if(this.failed){const r=i("p","seo-graph__error");r.setAttribute("role","status"),r.append(k("circle-alert"),i("span","",e.graphFailed)),t.push(r)}if(!this.hasAttribute("disabled")){const r=i("button","seo-graph__button",this.getAttribute("label")||e.graphAction);r.type="button",r.addEventListener("click",()=>this.check()),t.push(r)}this.replaceChildren(...t)}fill(){return P(this,"fill-values",{})}}const ge="golem15-seo-image";function be(n){return/^\/(?![\/\\])/.test(n)||/^https?:\/\//i.test(n)}class we extends HTMLElement{static observedAttributes=["disabled","invalid","ui-locale"];current="";pending="";error="";onUploadResult=e=>{const t=e.detail;!t||t.id!==this.pending||(this.pending="",typeof t.url=="string"&&t.url!==""?(this.current=t.url,this.error="",N(this,"summer-change",{value:this.current})):this.error=t.error||this.labels().imageFailed,this.render())};get value(){return this.current}set value(e){this.current=typeof e=="string"?e:"",this.render()}connectedCallback(){this.addEventListener("summer-upload-result",this.onUploadResult),this.render()}disconnectedCallback(){this.removeEventListener("summer-upload-result",this.onUploadResult)}attributeChangedCallback(){this.isConnected&&this.render()}labels(){return L(v(this))}render(){const e=this.labels(),t=this.hasAttribute("disabled"),s=[];if(this.current&&be(this.current)){const r=i("div","seo-image__preview"),a=i("img","seo-image__img");a.src=this.current,a.alt=e.imageAlt,a.width=240,a.height=126,r.append(a),s.push(r)}if(!t){const r=i("div","seo-image__actions"),a=T("seo-image-file"),c=i("input","seo-visually-hidden");c.type="file",c.accept="image/jpeg,image/png,image/gif,image/webp",c.id=a,c.addEventListener("change",()=>{const d=c.files?.[0];d&&(this.pending=T("seo-image-upload"),this.error="",this.render(),N(this,"summer-upload",{id:this.pending,file:d}))});const l=i("label","seo-image__button",this.current?e.imageReplace:e.imageUpload);if(l.htmlFor=a,r.append(c,l),this.current){const d=i("button","seo-image__button seo-image__button--secondary",e.imageRemove);d.type="button",d.addEventListener("click",()=>{this.current="",this.error="",N(this,"summer-change",{value:""}),this.render()}),r.append(d)}s.push(r)}const o=i("div","seo-image__status"+(this.error?" seo-image__status--error":""));o.setAttribute("role","status"),o.textContent=this.pending?e.imageUploading:this.error,s.push(o),this.classList.toggle("seo-image--invalid",this.hasAttribute("invalid")),this.replaceChildren(...s)}}const _t="golem15-seo-links";function V(){return typeof navigator<"u"&&!!navigator.clipboard&&typeof navigator.clipboard.writeText=="function"}function ye(n,e){const t=new Date(n);if(Number.isNaN(t.getTime()))return n;try{return new Intl.DateTimeFormat(e,{dateStyle:"medium",timeStyle:"short"}).format(t)}catch{return t.toISOString()}}class ve extends HTMLElement{static observedAttributes=["busy","state","ui-locale","disabled"];data=null;failed=!1;pending=!1;shownLocale="";copied="";copiedTimer;connected=!1;actions=new F(this,()=>this.fail());onResult=e=>{const t=e.detail;this.actions.settle();const s=t?.data;s&&Array.isArray(s.out)&&Array.isArray(s.in)&&(this.data=s,this.failed=!1),this.pending=this.actions.current!==null,this.render()};onLocale=e=>{const t=e.detail;typeof t=="string"&&t!==""&&t!==this.shownLocale&&(this.shownLocale=t,this.load())};connectedCallback(){this.connected=!0,this.addEventListener("summer-result",this.onResult),window.addEventListener("summer:ml-locale",this.onLocale),this.render(),queueMicrotask(()=>{this.connected&&this.load()})}disconnectedCallback(){this.connected=!1,this.removeEventListener("summer-result",this.onResult),window.removeEventListener("summer:ml-locale",this.onLocale),clearTimeout(this.copiedTimer),this.actions.reset(),this.pending=!1}attributeChangedCallback(e,t,s){if(this.connected){if(e==="busy"&&s===null){this.actions.flush();return}if(e==="state"&&s==="error"){this.actions.settle()&&this.fail();return}this.render()}}labels(){return L(v(this))}load(){this.pending=!0,this.actions.request({op:"links",locale:this.shownLocale}),this.render()}fail(){this.failed=!0,this.pending=this.actions.current!==null,this.render()}copy(e){V()&&navigator.clipboard.writeText(e).then(()=>{this.copied=e,clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout(()=>{this.copied="",this.render()},2e3),this.render()},()=>{})}line(e,t,s,o){const r=i("span","seo-links__line"),[a,c=""]=e.linksPhrase.split(":title");if(r.append(y(a??"",{phrase:t})),o){const l=i("a","seo-links__title",s);l.href=o,l.target="_blank",l.rel="noopener",r.append(l)}else r.append(i("span","seo-links__title",s));return r.append(y(c,{phrase:t})),r}render(){if(!this.connected)return;const e=this.labels(),t=v(this),s=[];if(this.setAttribute("aria-busy",String(this.pending)),this.pending){const a=i("p","seo-links__meta seo-links__checking",e.linksChecking);a.setAttribute("role","status"),s.push(a)}const o=this.data;if(o){const a=i("div","seo-links__counts");if(o.crawledAt!==null&&o.inbound!==null&&o.outbound!==null){const u=i("div","summer-stats");for(const[h,m]of[[o.inbound,e.linksInbound],[o.outbound,e.linksOutbound]]){const b=i("div","summer-stat");b.append(i("span","summer-stat__value",S(h,t)),i("span","summer-stat__label",m)),u.append(b)}a.append(u,i("p","seo-links__meta",y(e.linksCrawled,{time:ye(o.crawledAt,t)})))}else a.append(i("p","seo-links__meta seo-links__not-crawled",e.linksNotCrawled));if(s.push(a),o.orphan){const u=i("div","summer-callout summer-callout--warning seo-links__orphan");u.append(i("p","summer-callout__title",e.linksOrphanTitle),i("p","summer-callout__text",e.linksOrphanText)),s.push(u)}const c=V(),l=i("div","seo-links__list seo-links__list--out");l.append(i("p","seo-links__heading",e.linksOut));for(const u of o.out.slice(0,10)){const h=i("div","seo-links__row");if(h.append(this.line(e,u.phrase,u.title,u.url)),c&&!this.hasAttribute("disabled")){const m=i("button","seo-links__copy",e.linksCopy);m.type="button",m.addEventListener("click",()=>this.copy(u.url)),h.append(m)}else h.append(i("code","seo-links__url",u.url));l.append(h)}o.out.length===0&&l.append(i("p","seo-links__meta seo-links__none",e.linksNone)),s.push(l);const d=i("div","seo-links__list seo-links__list--in");d.append(i("p","seo-links__heading",e.linksIn));for(const u of o.in.slice(0,10)){const h=i("div","seo-links__row");h.append(this.line(e,u.phrase,u.title,u.adminUrl)),d.append(h)}o.in.length===0&&d.append(i("p","seo-links__meta seo-links__none",e.linksNone)),s.push(d)}if(this.failed){const a=i("p","seo-links__error");a.setAttribute("role","status"),a.append(k("circle-alert"),i("span","",e.linksFailed)),s.push(a)}const r=i("p","seo-links__status",this.copied?e.linksCopied:"");r.setAttribute("role","status"),s.push(r),this.replaceChildren(...s)}}const kt="golem15-seo-parent";function _e(n){if(typeof n=="string")return{selected:n,options:[]};const e={selected:"",options:[]};if(n&&typeof n=="object"){const t=n;if(e.selected=typeof t.selected=="string"?t.selected:"",Array.isArray(t.options)){for(const s of t.options)if(s&&typeof s=="object"&&typeof s.value=="string"){const o=s;e.options.push({value:o.value,label:typeof o.label=="string"&&o.label?o.label:o.value})}}}return e}class ke extends HTMLElement{static observedAttributes=["disabled","invalid","ui-locale"];current={selected:"",options:[]};get value(){return this.current.options.some(e=>e.value===this.current.selected)?this.current.selected:""}set value(e){const t=_e(e);typeof e=="string"&&this.current.options.length>0&&(t.options=this.current.options),this.current=t,this.render()}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}render(){if(!this.isConnected)return;const e=L(v(this)),t=i("select","seo-parent__select");t.id=T("seo-parent"),t.disabled=this.hasAttribute("disabled");const s=i("option","",e.primaryDefault);s.value="",t.append(s);for(const o of this.current.options){const r=i("option","",o.label);r.value=o.value,t.append(r)}t.value=this.value,t.addEventListener("change",()=>{this.current.selected=t.value,N(this,"summer-change",{value:t.value})}),this.classList.toggle("seo-parent--invalid",this.hasAttribute("invalid")),this.replaceChildren(t)}}const xe="golem15-seo-robots";function D(){return{index:"",follow:"",noarchive:!1,nosnippet:!1,noimageindex:!1,maxSnippet:null,maxImagePreview:"",maxVideoPreview:null,unavailableAfter:""}}function oe(n){const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(!e)return!1;const t=Number(e[1]),s=Number(e[2]),o=Number(e[3]);if(s<1||s>12||o<1)return!1;const a=[31,t%4===0&&t%100!==0||t%400===0?29:28,31,30,31,30,31,31,30,31,30,31][s-1];return o<=a}function ze(n){const e=D(),t=n.trim();if(t==="")return e;const s=new Set;for(const o of t.split(",")){const r=o.trim().toLowerCase();if(r==="")return null;const a=r.indexOf(":"),c=(a<0?r:r.slice(0,a)).trim(),l=a<0?null:r.slice(a+1).trim(),d=c==="noindex"?"index":c==="nofollow"?"follow":c;if(s.has(d))return null;switch(s.add(d),c){case"index":case"noindex":if(l!==null)return null;e.index=c;break;case"follow":case"nofollow":if(l!==null)return null;e.follow=c;break;case"noarchive":case"nosnippet":case"noimageindex":if(l!==null)return null;e[c]=!0;break;case"max-snippet":case"max-video-preview":{if(l===null||!/^[+-]?\d+$/.test(l))return null;const u=Number.parseInt(l,10);if(u<-1)return null;c==="max-snippet"?e.maxSnippet=u:e.maxVideoPreview=u;break}case"max-image-preview":if(l!=="none"&&l!=="standard"&&l!=="large")return null;e.maxImagePreview=l;break;case"unavailable_after":if(l===null||!oe(l))return null;e.unavailableAfter=l;break;default:return null}}return e}function Ae(n){const e=[];return n.index&&e.push(n.index),n.follow&&e.push(n.follow),n.noarchive&&e.push("noarchive"),n.nosnippet&&e.push("nosnippet"),n.noimageindex&&e.push("noimageindex"),n.maxSnippet!==null&&e.push("max-snippet:"+n.maxSnippet),n.maxImagePreview&&e.push("max-image-preview:"+n.maxImagePreview),n.maxVideoPreview!==null&&e.push("max-video-preview:"+n.maxVideoPreview),n.unavailableAfter&&e.push("unavailable_after:"+n.unavailableAfter),e.join(",")}function U(n){return[n.noarchive,n.nosnippet,n.noimageindex,n.maxSnippet!==null,n.maxImagePreview!=="",n.maxVideoPreview!==null,n.unavailableAfter!==""].filter(Boolean).length}class Te extends HTMLElement{static observedAttributes=["options","disabled","invalid","ui-locale","locale"];current="";model=D();open=!1;unparsed=!1;get value(){return this.current}set value(e){const t=typeof e=="string"?e:e==null?"":String(e);if(t===this.current&&this.childElementCount>0)return;this.current=t;const s=ze(t);this.unparsed=s===null,this.model=s??D(),this.open=this.open||U(this.model)>0,this.render()}connectedCallback(){this.open=U(this.model)>0,this.render()}attributeChangedCallback(){this.isConnected&&this.render()}labels(){return L(v(this))}commit(){this.unparsed||(this.current=Ae(this.model),N(this,"summer-change",{value:this.current}),this.render())}render(){const e=this.labels(),t=this.hasAttribute("disabled")||this.unparsed,o=P(this,"options",{}).scope==="type"?e.siteDefault:e.inherit;this.classList.toggle("seo-robots--invalid",this.hasAttribute("invalid"));const r=document.activeElement&&this.contains(document.activeElement)?document.activeElement.dataset.focusKey:void 0,a=i("div","seo-robots__groups");a.append(this.radioGroup(e.indexing,"index",[["",o,"inherit"],["index",e.index,"ok"],["noindex",e.noindex,"danger"]],t),this.radioGroup(e.links,"follow",[["",o,"inherit"],["follow",e.follow,"ok"],["nofollow",e.nofollow,"danger"]],t));const c=T("seo-robots-advanced"),l=i("button","seo-robots__toggle");l.type="button",l.setAttribute("aria-expanded",this.open?"true":"false"),l.setAttribute("aria-controls",c),l.dataset.focusKey="toggle",l.append(i("span","",e.advanced),k("chevron-down")),l.addEventListener("click",()=>{this.open=!this.open,this.render()});const d=i("div","seo-robots__advanced-row");d.append(l);const u=U(this.model);u>0&&d.append(i("span","seo-robots__summary",I(e.advancedSet,u,v(this))));const h=i("div","seo-robots__panel");h.id=c,h.hidden=!this.open,h.append(this.numberField(e.maxSnippet,e.maxSnippetHint,"maxSnippet",t,e),this.selectField(e,t),this.numberField(e.maxVideoPreview,"","maxVideoPreview",t,e),this.dateField(e,t));const m=i("div","seo-robots__checks");for(const p of["noarchive","nosnippet","noimageindex"]){const f=i("label","seo-robots__check"),g=i("input");g.type="checkbox",g.checked=this.model[p],g.disabled=t,g.dataset.focusKey=p,g.addEventListener("change",()=>{this.model[p]=g.checked,this.commit()}),f.append(g,i("span","",e[p])),m.append(f)}h.append(m);const b=[a,d,h];if(this.unparsed){const p=i("div","seo-robots__unparsed");if(p.setAttribute("role","status"),p.append(k("triangle-alert"),i("span","",y(e.robotsUnparsed,{value:this.current}))),!this.hasAttribute("disabled")){const f=i("button","seo-robots__reset",e.robotsReset);f.type="button",f.dataset.focusKey="reset",f.addEventListener("click",()=>{this.unparsed=!1,this.model=D(),this.commit()}),p.append(f)}b.unshift(p)}this.replaceChildren(...b),r&&this.querySelector(`[data-focus-key="${r}"]`)?.focus()}radioGroup(e,t,s,o){const r=i("div","seo-robots__group"),a=T("seo-robots-caption"),c=i("span","seo-robots__caption",e);c.id=a;const l=i("div","seo-robots__track");l.setAttribute("role","radiogroup"),l.setAttribute("aria-labelledby",a);const d=this.model[t];return s.forEach(([u,h,m],b)=>{const p=i("button","seo-robots__segment seo-robots__segment--"+m,h);p.type="button",p.setAttribute("role","radio");const f=d===u;p.setAttribute("aria-checked",f?"true":"false"),p.tabIndex=f?0:-1,p.disabled=o,p.dataset.focusKey=t+"-"+b,p.addEventListener("click",()=>this.choose(t,u)),p.addEventListener("keydown",g=>{const z=g.key==="ArrowRight"||g.key==="ArrowDown"?1:g.key==="ArrowLeft"||g.key==="ArrowUp"?-1:0;if(z===0||o)return;g.preventDefault();const w=(b+z+s.length)%s.length;this.choose(t,s[w][0]),this.querySelector(`[data-focus-key="${t}-${w}"]`)?.focus()}),l.append(p)}),r.append(c,l),r}choose(e,t){this.hasAttribute("disabled")||(e==="index"?this.model.index=t:this.model.follow=t,this.commit())}numberField(e,t,s,o,r){const a=i("label","seo-robots__field");a.append(i("span","seo-robots__label",e));const c=i("input","seo-robots__input");c.type="number",c.min="-1",c.step="1",c.disabled=o,c.dataset.focusKey=s;const l=this.model[s];c.value=l===null?"":String(l);const d=i("span","seo-robots__error");return d.setAttribute("role","status"),c.addEventListener("change",()=>{const u=c.value.trim();if(u===""){this.model[s]=null,this.commit();return}if(!/^-?\d+$/.test(u)||Number.parseInt(u,10)<-1){d.textContent=r.invalidNumber;return}this.model[s]=Number.parseInt(u,10),this.commit()}),a.append(c),t&&a.append(i("span","seo-robots__hint",t)),a.append(d),a}selectField(e,t){const s=i("label","seo-robots__field");s.append(i("span","seo-robots__label",e.maxImagePreview));const o=i("select","seo-robots__input");o.disabled=t,o.dataset.focusKey="maxImagePreview";for(const[r,a]of[["",e.notSet],["none",e.none],["standard",e.standard],["large",e.large]]){const c=i("option","",a);c.value=r,c.selected=this.model.maxImagePreview===r,o.append(c)}return o.addEventListener("change",()=>{this.model.maxImagePreview=o.value,this.commit()}),s.append(o),s}dateField(e,t){const s=i("label","seo-robots__field");s.append(i("span","seo-robots__label",e.unavailableAfter));const o=i("input","seo-robots__input");return o.type="date",o.disabled=t,o.dataset.focusKey="unavailableAfter",o.value=this.model.unavailableAfter,o.addEventListener("change",()=>{this.model.unavailableAfter=oe(o.value)?o.value:"",this.commit()}),s.append(o),s}}const Se="golem15-seo-robotstester",Z=["Googlebot","Googlebot-Image","Bingbot","*"];function Ce(n,e){const t={agent:e.agent,line:e.line,rule:e.rule};return e.allowed?e.line>0?y(n.allowedRule,t):y(n.allowedNone,t):e.bot?y(n.blockedBot,t):y(n.blocked,t)}class Le extends HTMLElement{static observedAttributes=["busy","state","ui-locale","disabled","label","busy-label"];context=null;result=null;error="";actions=new F(this,e=>this.failed(e));connected=!1;input=null;select=null;button=null;line=null;notes=null;builtFor="";onResult=e=>{const s=e.detail?.data;this.actions.settle(),s&&s.op==="context"?(this.context=s,this.build(!0)):s&&s.op==="test"&&(this.result=s,this.error="",this.renderResult())};connectedCallback(){this.connected=!0,this.addEventListener("summer-result",this.onResult),this.build(!1),queueMicrotask(()=>{this.connected&&!this.context&&this.request({op:"context"})})}disconnectedCallback(){this.connected=!1,this.removeEventListener("summer-result",this.onResult),this.actions.reset()}attributeChangedCallback(e,t,s){if(this.connected){if(e==="busy"&&s===null&&this.actions.flush(),e==="state"&&s==="error"&&this.actions.settle(),e==="ui-locale"){this.build(!0);return}this.syncControls()}}labels(){return L(v(this))}request(e){this.actions.request(e)}failed(e){e.op==="test"&&(this.error=this.labels().testFailed,this.result=null,this.renderResult())}build(e){const t=v(this)+"|"+(this.context?.agents??Z).join(",");if(!e&&this.builtFor===t&&this.input){this.syncControls();return}this.builtFor=t;const s=this.labels(),o=this.input?.value??"",r=this.select?.value??"Googlebot";this.replaceChildren();const a=i("div","seo-robotstester__row"),c=T("seo-robotstester-url"),l=i("div","seo-robotstester__field seo-robotstester__field--url"),d=i("label","seo-robotstester__label",s.url);d.htmlFor=c;const u=i("input","seo-robotstester__input");u.id=c,u.type="text",u.placeholder=s.urlPlaceholder,u.value=o,u.addEventListener("keydown",w=>{w.key==="Enter"&&(w.preventDefault(),this.test())}),l.append(d,u);const h=T("seo-robotstester-agent"),m=i("div","seo-robotstester__field seo-robotstester__field--agent"),b=i("label","seo-robotstester__label",s.agent);b.htmlFor=h;const p=i("select","seo-robotstester__select");p.id=h;for(const w of this.context?.agents??Z){const x=i("option","",w);x.value=w,p.append(x)}p.value=r,p.value!==r&&(p.value="Googlebot"),m.append(b,p);const f=i("button","seo-robotstester__button");f.type="button",f.addEventListener("click",()=>this.test()),a.append(l,m,f);const g=i("div","seo-robotstester__result");g.setAttribute("role","status");const z=i("div","seo-robotstester__notes");this.input=u,this.select=p,this.button=f,this.line=g,this.notes=z,this.append(a,g,z),this.syncControls(),this.renderResult()}syncControls(){if(!this.button||!this.input||!this.select)return;const e=this.hasAttribute("disabled"),t=this.hasAttribute("busy");this.input.readOnly=e,this.select.disabled=e,this.button.hidden=e,this.button.disabled=t,this.button.textContent=t?this.getAttribute("busy-label")||this.getAttribute("label")||"":this.getAttribute("label")||""}test(){if(this.hasAttribute("disabled")||!this.input||!this.select)return;const e=this.input.value.trim();if(!e.startsWith("/")){this.error=this.labels().urlRequired,this.result=null,this.renderResult();return}this.error="",this.request({op:"test",url:e,agent:this.select.value})}renderResult(){if(!this.line||!this.notes)return;const e=this.labels();if(this.line.className="seo-robotstester__result",this.error)this.line.classList.add("seo-robotstester__result--error"),this.line.replaceChildren(i("span","",this.error));else if(this.result){const s=this.result.allowed;this.line.classList.add(s?"seo-robotstester__result--allowed":"seo-robotstester__result--blocked"),this.line.replaceChildren(k(s?"circle-check":"triangle-alert"),i("span","",Ce(e,this.result)))}else this.line.replaceChildren();const t=[];(this.context?.staging||P(this,"data",{}).staging)&&t.push(i("p","seo-robotstester__note",e.stagingNote)),t.push(i("p","seo-robotstester__note",e.unsaved)),this.notes.replaceChildren(...t)}}const Ne="golem15-seo-robotstxt",Ee=500*1024,H=10,Pe=["User-agent","Allow","Disallow","Sitemap","Crawl-delay","Host","Clean-param"];function je(n,e){const t=Array.from({length:e.length+1},(s,o)=>o);for(let s=1;s<=n.length;s++){let o=t[0];t[0]=s;for(let r=1;r<=e.length;r++){const a=t[r];t[r]=Math.min(t[r]+1,t[r-1]+1,o+(n[s-1]===e[r-1]?0:1)),o=a}}return t[e.length]}function Re(n){const e=n.toLowerCase();let t="",s=3;for(const o of Pe){const r=je(e,o.toLowerCase());r{const r=o+1,a=s.indexOf("#"),c=(a>=0?s.slice(0,a):s).trim();if(c==="")return;const l=c.indexOf(":");if(l<0){e.push({kind:"noColon",line:r});return}const d=c.slice(0,l).trim(),u=c.slice(l+1).trim();switch(d.toLowerCase()){case"user-agent":t=!0;return;case"allow":case"disallow":t?u!==""&&!u.startsWith("/")&&!u.startsWith("*")&&e.push({kind:"badPath",line:r}):e.push({kind:"noGroup",line:r});return;case"sitemap":e.push({kind:"ownSitemap",line:r});return;case"crawl-delay":e.push({kind:"crawlDelay",line:r});return;case"host":case"clean-param":return}const h=Re(d);e.push(h?{kind:"unknownSuggest",line:r,word:d,suggestion:h}:{kind:"unknown",line:r,word:d})}),e}function De(n){return new TextEncoder().encode(n).length}function Ie(n,e){return y(n[e.kind],{line:e.line,word:e.word??"",suggestion:e.suggestion??""})}class Fe extends HTMLElement{static observedAttributes=["disabled","invalid","ui-locale"];current="";control=null;panel=null;meter=null;builtFor="";get value(){return this.current}set value(e){this.current=typeof e=="string"?e:e==null?"":String(e),this.control&&this.control.value!==this.current&&(this.control.value=this.current),this.update()}connectedCallback(){this.build()}attributeChangedCallback(e){if(this.isConnected){if(e==="ui-locale"){this.build();return}this.sync()}}labels(){return L(v(this))}build(){const e=v(this);if(this.builtFor===e&&this.control){this.sync();return}this.builtFor=e,this.replaceChildren();const t=T("seo-robotstxt-lint"),s=i("textarea","seo-robotstxt__control");s.spellcheck=!1,s.setAttribute("wrap","off"),s.value=this.current,s.setAttribute("aria-describedby",t);const o=this.getAttribute("field-name");o&&s.setAttribute("aria-label",o),s.addEventListener("input",()=>{this.hasAttribute("disabled")||(this.current=s.value,this.update(),N(this,"summer-change",{value:this.current}))});const r=i("div","seo-robotstxt__lint");r.id=t,r.setAttribute("role","status");const a=i("div","seo-robotstxt__size");this.control=s,this.panel=r,this.meter=a,this.append(s,r,a),this.sync()}sync(){this.control&&(this.control.readOnly=this.hasAttribute("disabled"),this.classList.toggle("seo-robotstxt--invalid",this.hasAttribute("invalid")),this.control.setAttribute("aria-invalid",this.hasAttribute("invalid")?"true":"false"),this.update())}update(){if(!this.panel||!this.meter)return;const e=this.labels(),t=v(this),s=Oe(this.current),o=[];if(s.length===0){const l=i("div","seo-robotstxt__finding seo-robotstxt__finding--clean");l.append(k("circle-check"),i("span","",e.clean)),o.push(l)}else{for(const l of s.slice(0,H)){const d=i("div","seo-robotstxt__finding");d.append(k("triangle-alert"),i("span","",Ie(e,l))),o.push(d)}s.length>H&&o.push(i("div","seo-robotstxt__more",y(e.moreFindings,{count:S(s.length-H,t)})))}this.panel.replaceChildren(...o);const r=De(this.current),a=new Intl.NumberFormat(t,{maximumFractionDigits:1}).format(r/1024)+" KB";this.meter.replaceChildren(i("span","",y(e.size,{size:a})));const c=r>Ee;this.classList.toggle("seo-robotstxt--over",c),c&&this.meter.append(i("span","seo-robotstxt__over",e.tooLarge))}}const xt="golem15-seo-schema",Me=16*1024;function $(n){switch(n){case"article":return["BlogPosting","Article","NewsArticle"];case"collection":return["CollectionPage"];case"profile":return["ProfilePage"]}return["WebPage","AboutPage","ContactPage","Service"]}function Ue(n){const e={type:"",fields:{},custom:""};if(typeof n!="string"||n.trim()==="")return e;try{const t=JSON.parse(n);e.type=typeof t.type=="string"?t.type:"",e.fields=t.fields&&typeof t.fields=="object"?{...t.fields}:{},e.custom=typeof t.custom=="string"?t.custom:""}catch{}return e}function He(n){const e={};for(const s of["serviceType","areaServed","price","currency"]){const o=(n.fields[s]??"").trim();o!==""&&(e[s]=o)}const t=n.custom.trim();return n.type===""&&t===""&&Object.keys(e).length===0?"":JSON.stringify({type:n.type,fields:e,custom:t})}function Be(n){return n.trim()===""||/^\d+([.,]\d{1,2})?$/.test(n.trim())}function X(n){return n.trim()===""||/^[A-Za-z]{3}$/.test(n.trim())}function Y(n,e){const s=n.slice(0,Math.max(0,Math.min(e,n.length))).split(` `);return{line:s.length,column:s[s.length-1].length+1}}function Q(n){if(n.trim()==="")return{kind:"empty"};if(new TextEncoder().encode(n.trim()).length>Me)return{kind:"tooLarge"};let e;try{e=JSON.parse(n)}catch(s){const o=s instanceof Error?s.message:String(s),r=/line (\d+) column (\d+)/i.exec(o);if(r)return{kind:"error",line:Number(r[1]),column:Number(r[2]),message:o};const a=/position (\d+)/i.exec(o),c=a?Y(n,Number(a[1])):Y(n,n.length);return{kind:"error",line:c.line,column:c.column,message:o}}const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s);return t(e)?{kind:"valid",nodes:1}:Array.isArray(e)&&e.length>0&&e.every(t)?{kind:"valid",nodes:e.length}:{kind:"notObject"}}const ee=(n,e)=>n["t"+e]??e,We=(n,e)=>{switch(e){case"BlogPosting":case"Article":case"NewsArticle":return n.noteArticle;case"ContactPage":return n.noteContact;case"Service":return n.noteService;case"CollectionPage":return n.noteCollection;case"ProfilePage":return n.noteProfile}return n.notePage};class Ge extends HTMLElement{static observedAttributes=["options","disabled","invalid","ui-locale"];current={type:"",fields:{},custom:""};open=!1;status={kind:"empty"};timer;fieldErrors={};connected=!1;get value(){return He(this.current)}set value(e){this.current=Ue(e),this.status=Q(this.current.custom),this.open=this.current.custom.trim()!=="",this.render()}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){this.connected=!1,clearTimeout(this.timer)}attributeChangedCallback(){this.connected&&this.render()}kind(){const e=P(this,"options",{});return typeof e.kind=="string"?e.kind:""}labels(){return L(v(this))}changed(){N(this,"summer-change",{value:this.value})}effectiveType(){const e=$(this.kind());return e.includes(this.current.type)?this.current.type:e[0]}render(){if(!this.connected)return;const e=this.labels(),t=this.hasAttribute("disabled"),s=$(this.kind()),o=[],r=i("div","seo-schema__section"),a=T("seo-schema-type"),c=i("label","seo-schema__label",e.schemaType);if(c.htmlFor=a,s.length>1){const m=i("select","seo-schema__select");m.id=a,m.disabled=t;const b=i("option","",y(e.typeDefault,{type:s[0]}));b.value="",m.append(b);for(const p of s){const f=i("option","",ee(e,p));f.value=p,m.append(f)}m.value=s.includes(this.current.type)?this.current.type:"",m.addEventListener("change",()=>{this.current.type=m.value,this.changed(),this.render()}),r.append(c,m)}else{const m=i("div","seo-schema__fixed",ee(e,s[0]));m.id=a,r.append(c,m)}if(r.append(i("p","seo-schema__note",We(e,this.effectiveType()))),o.push(r),this.effectiveType()==="Service"){const m=i("div","seo-schema__grid"),b=(p,f,g,z="",w="")=>{const x=i("div","seo-schema__cell"),_=T("seo-schema-"+p),C=i("label","seo-schema__label",f);C.htmlFor=_;const A=i("input","seo-schema__input");A.id=_,A.type="text",A.disabled=t,A.value=this.current.fields[p]??"",z&&(A.placeholder=z),w&&(A.inputMode=w),p==="currency"&&(A.maxLength=3);const R=i("p","seo-schema__error",this.fieldErrors[p]??"");R.setAttribute("role","status"),A.addEventListener("input",()=>{const M=A.value;(p==="price"?Be(M):p==="currency"?X(M):!0)?(this.current.fields[p]=M,delete this.fieldErrors[p],R.textContent="",this.changed()):(this.fieldErrors[p]=p==="price"?e.priceInvalid:e.currencyInvalid,R.textContent=this.fieldErrors[p])}),p==="currency"&&A.addEventListener("blur",()=>{A.value=A.value.toUpperCase(),X(A.value)&&(this.current.fields.currency=A.value,this.changed())}),x.append(C,A),g&&x.append(i("p","seo-schema__note",g)),x.append(R),m.append(x)};b("serviceType",e.serviceType,"",e.serviceTypePh),b("areaServed",e.areaServed,e.areaServedHint),b("price",e.price,e.priceHint,"","decimal"),b("currency",e.currency,e.currencyHint),o.push(m)}const l=i("div","seo-schema__section"),d=i("button","seo-schema__disclosure");d.type="button",d.setAttribute("aria-expanded",String(this.open));const u=T("seo-schema-custom");d.setAttribute("aria-controls",u),d.append(i("span","",e.custom),k("chevron-down")),d.addEventListener("click",()=>{this.open=!this.open,this.render()});const h=i("div","seo-schema__disclosure-row");if(h.append(d),this.current.custom.trim()!==""&&h.append(i("span","seo-schema__note",e.customSet)),l.append(h),this.open){const m=i("div","seo-schema__panel");m.id=u;const b=T("seo-schema-json"),p=i("p","seo-schema__note",e.customHint);p.id=b+"-hint";const f=i("textarea","seo-schema__json");f.id=b,f.spellcheck=!1,f.disabled=t,f.value=this.current.custom,f.setAttribute("aria-label",e.custom),f.setAttribute("aria-describedby",p.id);const g=i("p","seo-schema__status");g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),this.statusLine(g,e),f.addEventListener("input",()=>{this.current.custom=f.value,this.changed(),clearTimeout(this.timer),this.timer=setTimeout(()=>{this.status=Q(f.value),this.statusLine(g,e)},300)}),m.append(p,f,g),l.append(m)}o.push(l),this.classList.toggle("seo-schema--invalid",this.hasAttribute("invalid")),this.replaceChildren(...o)}statusLine(e,t){const s=this.status;switch(e.className="seo-schema__status",s.kind){case"empty":e.replaceChildren();return;case"valid":e.classList.add("seo-schema__status--ok"),e.replaceChildren(k("circle-check"),i("span","",I(t.jsonValid,s.nodes,v(this))));return;case"error":e.classList.add("seo-schema__status--error"),e.replaceChildren(k("circle-alert"),i("span","",y(t.jsonError,{line:s.line,column:s.column,message:s.message})));return;case"notObject":e.classList.add("seo-schema__status--error"),e.replaceChildren(k("circle-alert"),i("span","",t.jsonNotObject));return;case"tooLarge":e.classList.add("seo-schema__status--error"),e.replaceChildren(k("circle-alert"),i("span","",t.jsonTooLarge))}}}const re="20px Arial, sans-serif",ae="14px Arial, sans-serif",le=580,ce=920,qe=680,Je=30,Ke=120;let j;function Ve(){if(j!==void 0)return j;try{const e=document.createElement("canvas").getContext("2d");j=e&&typeof e.measureText=="function"?e:null}catch{j=null}return j}function Ze(n,e){let t=0;for(const s of n)/[ilIj.,:;'!|]/.test(s)?t+=.28:/[mwMW@]/.test(s)?t+=.85:/[A-Z]/.test(s)?t+=.67:s===" "?t+=.28:t+=.53;return t*e}function G(n,e){const t=Ve();if(t){t.font=e;const o=t.measureText(n).width;if(Number.isFinite(o)&&(o>0||n===""))return o}const s=Number.parseFloat(e)||14;return Ze(n,s)}const B=" …";function te(n,e,t){if(G(n,e)<=t)return n;const s=h=>G(h+B,e)<=t,o=Array.from(n),r=[];for(let h=1;h>1;s(o.slice(0,r[h]).join(""))?(a=h,c=h+1):l=h-1}if(a>=0)return o.slice(0,r[a]).join("")+B;let d=0,u=o.length;for(;ds?l="long":a=o}function O(n,e){const t=se(n);if(t.length===0)return!1;const s=se(e);for(let o=0;o+t.length<=s.length;o++){let r=!0;for(let a=0;athis.failed(e));duplicates=new Map;checking=!1;timer;lastChecked="";connected=!1;onResult=e=>{const s=e.detail?.data;this.actions.settle(),s&&s.op==="context"?(this.context=s,this.contextFailed=!1,this.render(),this.scheduleDuplicates(!0)):s&&s.op==="duplicates"&&(this.duplicates.set(s.locale,s),this.checking=!1,this.render())};onLocale=e=>{const t=e.detail;typeof t=="string"&&t!==""&&t!==this.shownLocale&&(this.shownLocale=t,this.render(),this.scheduleDuplicates(!1))};connectedCallback(){this.connected=!0,this.addEventListener("summer-result",this.onResult),window.addEventListener("summer:ml-locale",this.onLocale),this.render(),queueMicrotask(()=>{this.connected&&(this.context?this.scheduleDuplicates(!0):this.request({op:"context"}))})}disconnectedCallback(){this.connected=!1,this.removeEventListener("summer-result",this.onResult),window.removeEventListener("summer:ml-locale",this.onLocale),clearTimeout(this.timer),this.actions.reset(),this.checking=!1,this.lastChecked=""}attributeChangedCallback(e,t,s){if(this.connected){if(e==="busy"&&s===null){this.actions.flush();return}if(e==="state"&&s==="error"){const o=this.actions.settle();o?this.failed(o):(this.checking=!1,this.render());return}if(e==="fill-values"){this.render(),this.scheduleDuplicates(!1);return}this.render()}}labels(){return L(v(this))}request(e){this.actions.request(e)}failed(e){e.op==="context"?this.contextFailed=!0:this.lastChecked="",this.checking=!1,this.render()}fill(){return P(this,"fill-values",{})}locale(){const e=this.context?.locales??[];return e.length===0?null:e.find(t=>t.locale===this.shownLocale)??e[0]}scheduleDuplicates(e){const t=this.locale();if(!t)return;const s=this.fill(),o=E(s,"seo_title",t.locale)||E(s,"title",t.locale),r=E(s,"seo_description",t.locale)||E(s,"description",t.locale),a=JSON.stringify([t.locale,o,r]);if(a===this.lastChecked)return;clearTimeout(this.timer);const c=()=>{this.lastChecked=a,this.checking=!0,this.render(),this.request({op:"duplicates",locale:t.locale,title:o,description:r})};e?c():this.timer=setTimeout(c,Qe)}render(){const e=this.labels(),t=v(this);if(!this.context&&!this.contextFailed){this.setAttribute("aria-busy","true"),this.replaceChildren(i("div","seo-serp__skeleton"));return}this.removeAttribute("aria-busy");const s=this.locale(),o=s?.locale??this.shownLocale,r=this.fill(),a=(E(r,"seo_title",o)||E(r,"title",o)).trim(),c=(E(r,"seo_description",o)||E(r,"description",o)).trim(),l=E(r,"seo_keyphrase",o).trim(),d=s?.siteName??"",u=a||tt(s?.titleTemplate??"",{title:s?.defaultTitle??"",site:d})||s?.defaultTitle||"",h=c||s?.defaultDescription||"",m=i("div","seo-serp__header"),b=i("div","seo-serp__track");b.setAttribute("role","radiogroup"),b.setAttribute("aria-label",e.device);for(const _ of["desktop","mobile"]){const C=i("button","seo-serp__segment",e[_]);C.type="button",C.setAttribute("role","radio"),C.setAttribute("aria-checked",this.device===_?"true":"false"),C.addEventListener("click",()=>{this.device=_,this.render()}),b.append(C)}m.append(b),o&&m.append(i("span","seo-serp__language",y(e.language,{locale:o.toUpperCase()})));const p=i("div","serp-card"+(this.device==="mobile"?" serp-card--mobile":"")),f=i("div","serp-card__site");f.append(i("span","serp-card__favicon",Array.from(d||this.context?.host||"?")[0]?.toUpperCase()??"?"));const g=i("div","serp-card__names");if(g.append(i("span","serp-card__sitename",d||this.context?.host||"")),g.append(i("span","serp-card__crumbs",ot(this.context?.host??"",s?.url??null))),f.append(g),p.append(f),p.append(i("div","serp-card__title",te(u,re,le))),h){const _=this.device==="mobile"?qe:ce;p.append(i("div","serp-card__description",te(h,ae,_)))}else p.append(i("div","serp-card__description serp-card__description--missing",e.noDescription));const z=i("div","seo-serp__notes");if(this.contextFailed){const _=i("div","seo-serp__error");_.setAttribute("role","status"),_.append(k("circle-alert"),i("span","",e.contextFailed)),z.append(_)}!a&&s?.titleTemplate&&z.append(i("div","",y(e.fromTemplate,{template:s.titleTemplate}))),!c&&s?.defaultDescription&&s.descriptionSource==="content"&&z.append(i("div","",e.fromContent)),s&&s.url===null&&z.append(i("div","",e.noUrl)),(this.getAttribute("record-id")??"")!==""&&s&&z.append(i("div","",e.savedNote));const w=i("div","seo-serp__checks");if(w.setAttribute("role","status"),this.checking)w.append(i("div","seo-serp__checking",e.checking));else{const _=this.duplicates.get(o);if(_)for(const[C,A]of[[_.title,e.dupTitle],[_.description,e.dupDescription]])C.length>0&&w.append(rt(C,A,e,t))}const x=[m,p,z,w];l&&s&&x.push(at(l,{title:u,description:h,h1:s.h1,url:s.url,bodyWords:s.bodyWords},e,t)),this.replaceChildren(...x)}}function ot(n,e){const t=(e??"").split("?")[0].split("/").filter(Boolean).map(s=>{try{return decodeURIComponent(s)}catch{return s}});return[n,...t].filter(Boolean).join(" › ")}function rt(n,e,t,s){const o=i("div","seo-serp__check seo-serp__check--warn");o.append(k("triangle-alert"));const r=i("span"),a="\0list\0",c=I(e,n.length,s,{list:a}),[l,d]=c.split(a);return r.append(document.createTextNode(l??"")),n.slice(0,W).forEach((u,h)=>{if(h>0&&r.append(document.createTextNode(", ")),u.url.startsWith("/")&&!u.url.startsWith("//")){const m=i("a","seo-serp__link",u.label);m.href=u.url,m.target="_blank",m.rel="noopener",r.append(m)}else r.append(document.createTextNode(u.label))}),n.length>W&&r.append(document.createTextNode(" "+y(t.andMore,{count:n.length-W}))),r.append(document.createTextNode(d??"")),o.append(r),o}function at(n,e,t,s){const o=i("div","seo-serp__keyphrase");o.append(i("div","seo-serp__keyphrase-title",y(t.keyphrase,{phrase:n})));const r=(a,c,l)=>{const d=i("div","seo-serp__check "+(a?"seo-serp__check--ok":"seo-serp__check--warn"));d.append(k(a?"circle-check":"triangle-alert"),i("span","",a?c:l)),o.append(d)};if(r(O(n,e.title),t.kpTitle,t.kpTitleNo),e.h1!==null&&r(O(n,e.h1),t.kpH1,t.kpH1No),r(O(n,e.description),t.kpDesc,t.kpDescNo),e.url!==null&&r(O(n,e.url.replace(/[-_/]+/g," ")),t.kpUrl,t.kpUrlNo),e.bodyWords!==null){const a=new Intl.NumberFormat(s).format(e.bodyWords);r(e.bodyWords>=et,y(t.kpLength,{count:a}),y(t.kpLengthNo,{count:a}))}return o}const lt="golem15-seo-text",ct={empty:"info",short:"triangle-alert",long:"triangle-alert",good:"circle-check"};class dt extends HTMLElement{static observedAttributes=["options","disabled","invalid","ui-locale","locale"];current="";control=null;statusIcon=null;statusText=null;countText=null;live=null;lastStatus=null;builtFor="";get value(){return this.current}set value(e){this.current=typeof e=="string"?e:e==null?"":String(e),this.control&&this.control.value!==this.current&&(this.control.value=this.current),this.update(!1)}connectedCallback(){this.build()}attributeChangedCallback(e){if(this.isConnected){if(e==="options"||e==="ui-locale"){this.build();return}this.sync()}}measure(){return P(this,"options",{}).measure==="description"?"description":"title"}labels(){return L(v(this))}build(){const e=this.measure()+"|"+v(this);if(this.builtFor===e&&this.control){this.sync();return}this.builtFor=e,this.replaceChildren();const t=T("seo-text-counter"),o=this.measure()==="description"?i("textarea","seo-text__control seo-text__control--area"):i("input","seo-text__control");o instanceof HTMLTextAreaElement?o.rows=3:o.type="text",o.value=this.current,o.setAttribute("aria-describedby",t);const r=this.getAttribute("field-name");r&&o.setAttribute("aria-label",r),o.addEventListener("input",()=>{this.hasAttribute("disabled")||(this.current=o.value.replace(/\s+$/u,""),this.update(!0),N(this,"summer-change",{value:this.current}))});const a=i("div","seo-text__counter");a.id=t;const c=i("span","seo-text__status");this.statusIcon=i("span","seo-text__icon"),this.statusText=i("span","seo-text__status-text"),c.append(this.statusIcon,this.statusText),this.countText=i("span","seo-text__count"),a.append(c,this.countText),this.live=i("span","seo-visually-hidden"),this.live.setAttribute("aria-live","polite"),this.live.setAttribute("role","status"),this.control=o,this.lastStatus=null,this.append(o,a,this.live),this.sync()}sync(){if(!this.control)return;const e=this.hasAttribute("disabled");this.control.readOnly=e,this.classList.toggle("seo-text--invalid",this.hasAttribute("invalid")),this.control.setAttribute("aria-invalid",this.hasAttribute("invalid")?"true":"false"),this.update(!1)}update(e){if(!this.statusText||!this.countText||!this.statusIcon)return;const t=this.labels(),s=v(this),o=this.measure(),r=Xe(this.current,o),a=ut(t,r.status,o);this.statusIcon.replaceChildren(k(ct[r.status])),this.statusText.textContent=a,this.dataset.status=r.status,this.countText.textContent=y(t.count,{chars:S(r.chars,s),px:S(r.px,s),max:S(r.maxPx,s)}),e&&this.live&&r.status!==this.lastStatus&&(this.live.textContent=a),this.lastStatus=r.status}}function ut(n,e,t){switch(e){case"empty":return t==="title"?n.emptyTitle:n.emptyDescription;case"short":return t==="title"?n.shortTitle:n.shortDescription;case"long":return t==="title"?n.longTitle:n.longDescription;default:return n.good}}const ht="golem15-seo-transfer",ie=60*1024,q=200;function pt(n){return n.summary.refused>0?"refused":n.count>0?"ready":"nothing"}function mt(n){const e=n.filter(s=>s.change==="refused"),t=n.filter(s=>s.change!=="refused");return[...e,...t].slice(0,q)}function ft(n,e){const t=new Blob([e],{type:"text/csv;charset=utf-8"}),s=URL.createObjectURL(t),o=document.createElement("a");o.href=s,o.download=n,o.rel="noopener",document.body.append(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(s),0)}function gt(){return window.location.pathname.replace(/\/transfer(\/.*)?$/,"/history")}class bt extends HTMLElement{static observedAttributes=["busy","state","ui-locale","disabled","label","busy-label"];connected=!1;pending=null;exportDataset="redirects";importDataset="redirects";fileName="";csv="";fileError="";importError="";exportError="";applyError="";preview=null;applied=!1;onResult=e=>{const s=e.detail?.data;if(this.pending=null,!s){this.render();return}s.error!==void 0?s.op==="export"?this.exportError=s.message:s.op==="preview"?(this.importError=s.message,this.preview=null):this.applyError=s.message:s.op==="export"?(this.exportError="",ft(s.filename,s.csv)):s.op==="preview"?(this.importError="",this.applyError="",this.applied=!1,this.preview=s):s.op==="apply"&&(this.preview=null,this.applyError="",this.applied=!0),this.render()};connectedCallback(){this.connected=!0,this.addEventListener("summer-result",this.onResult),this.render()}disconnectedCallback(){this.connected=!1,this.removeEventListener("summer-result",this.onResult)}attributeChangedCallback(e,t,s){this.connected&&(e==="state"&&s==="error"&&(this.pending=null),e==="busy"&&s===null&&(this.pending=null),this.render())}labels(){return L(v(this))}request(e){this.hasAttribute("disabled")||this.hasAttribute("busy")||this.pending||(this.pending=e.op,N(this,"summer-action",{payload:e}),this.render())}busyLabel(e,t){return this.pending===e&&this.getAttribute("busy-label")||t}datasetSelect(e,t,s){const o=i("div","seo-transfer__field"),r=T("seo-transfer-dataset"),a=i("label","seo-transfer__label",e.dataset);a.htmlFor=r;const c=i("select","seo-transfer__select");c.id=r;const l=[["redirects",e.dsRedirects],["rules",e.dsRules],["records",e.dsRecords]];for(const[d,u]of l){const h=i("option","",u);h.value=d,c.append(h)}return c.value=t,c.disabled=this.hasAttribute("disabled"),c.addEventListener("change",()=>s(c.value)),o.append(a,c),o}button(e,t,s){const o=i("button","seo-transfer__button seo-transfer__button--"+t,e);return o.type="button",o.addEventListener("click",s),o}message(e,t){const s=i("p",t,e);return s.setAttribute("role","status"),s}async chooseFile(e){const t=e.files?.[0];if(this.preview=null,this.applied=!1,this.importError="",this.applyError="",this.csv="",!t){this.fileName="",this.fileError="",this.render();return}if(this.fileName=t.name,t.size>ie){this.fileError=y(this.labels().fileTooLarge,{limit:S(ie/1024,v(this))+" KB"}),this.render();return}try{this.csv=await t.text(),this.fileError=""}catch{this.fileError=this.labels().readFailed}this.render()}render(){const e=this.labels(),t=v(this),s=this.hasAttribute("disabled"),o=this.hasAttribute("busy")||this.pending!==null,r=this.getAttribute("label")||e.chooseFile,a=i("section","seo-transfer__section");a.append(i("h3","seo-transfer__heading",e.exportHeading));const c=i("div","seo-transfer__row");c.append(this.datasetSelect(e,this.exportDataset,f=>this.exportDataset=f));const l=this.button(this.busyLabel("export",e.download),"outline",()=>this.request({op:"export",dataset:this.exportDataset}));l.disabled=o,l.hidden=s,c.append(l),a.append(c),this.exportError&&a.append(this.message(this.exportError,"seo-transfer__error"));const d=i("section","seo-transfer__section seo-transfer__section--import");d.append(i("h3","seo-transfer__heading",e.importHeading));const u=i("div","seo-transfer__row");u.append(this.datasetSelect(e,this.importDataset,f=>{this.importDataset=f,this.preview=null,this.render()}));const h=i("input","seo-transfer__file");h.type="file",h.accept=".csv,text/csv",h.hidden=!0,h.addEventListener("change",()=>{this.chooseFile(h)});const m=this.button(e.chooseFile,"outline",()=>h.click());m.hidden=s,m.disabled=o;const b=i("span",this.fileName?"seo-transfer__filename":"seo-transfer__filename seo-transfer__filename--none",this.fileName||e.noFile),p=this.button(this.busyLabel("preview",r),"outline",()=>this.request({op:"preview",dataset:this.importDataset,csv:this.csv}));if(p.disabled=o||this.csv===""||this.fileError!=="",p.hidden=s,u.append(h,m,b,p),d.append(u),(this.fileError||this.importError)&&d.append(this.message(this.fileError||this.importError,"seo-transfer__error")),this.applied){const f=i("p","seo-transfer__done"),g=i("a","seo-transfer__link",e.openHistory);g.href=gt(),f.append(g),d.append(f)}this.preview&&d.append(this.renderPreview(e,t,o,s)),this.replaceChildren(a,d)}renderPreview(e,t,s,o){const r=this.preview,a=i("div","seo-transfer__preview"),c=r.summary;a.append(this.message(y(e.summary,{new:S(c.new,t),changed:S(c.changed,t),unchanged:S(c.unchanged,t),refused:S(c.refused,t)}),"seo-transfer__summary"));const l=i("div","summer-table-wrap seo-transfer__table-wrap"),d=i("table","summer-table seo-transfer__table"),u=i("tr");for(const w of[e.colLine,e.colChange,e.colAddress,e.colField,e.colBefore,e.colAfter,e.colNote])u.append(i("th","",w));const h=i("thead");h.append(u);const m=i("tbody"),b={new:e.bNew,changed:e.bChanged,unchanged:e.bUnchanged,refused:e.bRefused};for(const w of mt(r.rows)){const x=i("tr","seo-transfer__tr--"+w.change);x.append(i("td","seo-transfer__num",S(w.line,t)));const _=i("td");_.append(i("span","seo-transfer__badge seo-transfer__badge--"+w.change,b[w.change])),w.warning&&_.append(i("span","seo-transfer__badge seo-transfer__badge--warning",e.bWarning)),x.append(_),x.append(i("td","seo-transfer__mono",w.address)),x.append(i("td","",w.field)),x.append(i("td","",w.before)),x.append(i("td","",w.after)),x.append(i("td","",w.note)),m.append(x)}d.append(h,m),l.append(d),a.append(l),(r.total>q||r.rows.length>q)&&a.append(i("p","seo-transfer__note",y(e.rowCap,{count:S(Math.max(r.total,r.rows.length),t)})));const p=pt(r);p==="refused"?a.append(this.message(e.refusedBlocks,"seo-transfer__error")):p==="nothing"&&a.append(this.message(e.nothing,"seo-transfer__note")),this.applyError&&a.append(this.message(this.applyError,"seo-transfer__error"));const f=i("div","seo-transfer__actions"),g=this.button(e.discard,"ghost",()=>{this.preview=null,this.applyError="",this.render()});g.disabled=s;const z=this.button(this.busyLabel("apply",I(e.applyCount,r.count,t)),"primary",()=>this.request({op:"apply",token:r.token}));return z.disabled=s||p!=="ready",f.append(g,z),f.hidden=o,a.append(f),a}}const wt=[[lt,dt],[xe,Te],[Ye,nt],[ge,we],[Ne,Fe],[Se,Le],[ht,bt],["golem15-seo-schema",Ge],["golem15-seo-graph",fe],["golem15-seo-parent",ke],["golem15-seo-links",ve]];for(const[n,e]of wt)customElements.get(n)||customElements.define(n,e);export{vt as GRAPH_TAG,ge as IMAGE_TAG,_t as LINKS_TAG,kt as PARENT_TAG,Se as ROBOTSTESTER_TAG,Ne as ROBOTSTXT_TAG,xe as ROBOTS_TAG,xt as SCHEMA_TAG,Ye as SERP_TAG,fe as SeoGraphElement,we as SeoImageElement,ve as SeoLinksElement,ke as SeoParentElement,Te as SeoRobotsElement,Le as SeoRobotsTesterElement,Fe as SeoRobotsTxtElement,Ge as SeoSchemaElement,nt as SeoSerpElement,dt as SeoTextElement,bt as SeoTransferElement,lt as TEXT_TAG,ht as TRANSFER_TAG};