1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[58795],{795(e,t,n){n.r(t),n.d(t,{default:()=>o});class a{static open(e,t){let n=document.createElement("dialog");n.className="neon-dialog-overlay";let i=document.createElement("div");i.className="neon-dialog";let o=document.createElement("div");o.className="neon-dialog-header";let l=document.createElement("div");l.className="neon-dialog-title",l.textContent=e;let r=document.createElement("button");r.type="button",r.className="btn-close close neon-dialog-close",r.setAttribute("aria-label","Close"),o.appendChild(l),o.appendChild(r);let s=document.createElement("div");s.className="neon-dialog-body",s.appendChild(t),i.appendChild(o),i.appendChild(s),n.appendChild(i);let c=()=>a.close(n);return r.addEventListener("click",c),n.addEventListener("click",e=>{e.target===n&&c()}),n.addEventListener("cancel",e=>{e.preventDefault(),c()}),document.body.appendChild(n),n.showModal(),n}static close(e){e&&("function"==typeof e.close&&e.open&&e.close(),e.remove())}}let i=window.PluginBaseClass;class o extends i{static #e=this.options={createUrl:"",configurationId:"",productId:"",warnOnUpload:!0,texts:{}};static #t=this.UPLOAD_REFERENCE_PATTERN=/f:[0-9a-f]{8}(-[0-9a-f]{8}){5}/;init(){if(this.isBusy=!1,1!==document.querySelectorAll("[data-neon-configurator]").length){this.el.style.display="none";return}this.el.addEventListener("click",this.onClick.bind(this))}onClick(e){if(e.preventDefault(),this.isBusy)return;let t=this.getConfigurator();if(!t){this.showMessage(this.text("error"));return}let n=t.buildShareConfigString();if(this.options.warnOnUpload&&o.UPLOAD_REFERENCE_PATTERN.test(n)){this.confirmUpload(()=>this.createLink(t,n));return}this.createLink(t,n)}getConfigurator(){let e=document.querySelector(`[data-neon-configurator][data-neon-configurator-id="${this.options.configurationId}"]`);return e?window.PluginManager.getPluginInstanceFromElement(e,"NeonConfigurator"):null}confirmUpload(e){let t=document.createElement("div"),n=document.createElement("p");n.className="neonConfigurator__share__warning",n.textContent=this.text("uploadWarningText"),t.appendChild(n);let i=document.createElement("div");i.className="neonConfigurator__share__actions";let o=document.createElement("button");o.type="button",o.className="btn btn-secondary",o.textContent=this.text("cancelLabel");let l=document.createElement("button");l.type="button",l.className="btn btn-primary",l.textContent=this.text("confirmLabel"),i.appendChild(o),i.appendChild(l),t.appendChild(i);let r=a.open(this.text("uploadWarningHeadline"),t);o.addEventListener("click",()=>a.close(r)),l.addEventListener("click",()=>{a.close(r),e()})}async createLink(e,t){let n=this.labelElement();this.isBusy=!0;let a=n.textContent;n.textContent=this.text("creating"),this.el.disabled=!0;let i=new FormData;
1i.append("configString",t),i.append("productId",this.options.productId),i.append("configurationId",this.options.configurationId),i.append("quantity",await this.readQuantity(e));try{let e=await fetch(this.options.createUrl,{method:"POST",body:i}),t=await e.json();if(!e.ok||!t.success){this.showMessage(t.message||this.text("error"));return}this.showLink(t.url,t.expiresAt)}catch(e){this.showMessage(this.text("error"))}finally{this.isBusy=!1,n.textContent=a,this.el.disabled=!1}}labelElement(){return this.el.querySelector("[data-neon-configurator-share-label]")??this.el}async readQuantity(e){if("function"!=typeof e.getQuantity)return 1;try{let t=parseInt(await e.getQuantity(),10);return Number.isNaN(t)||t<1?1:t}catch(e){return 1}}showLink(e,t){let n=this,i=document.createElement("div"),o=document.createElement("p");o.textContent=n.text("dialogText"),i.appendChild(o);let l=document.createElement("div");l.className="neonConfigurator__share__result";let r=document.createElement("input");r.type="text",r.readOnly=!0,r.className="form-control",r.value=e,r.setAttribute("aria-label",n.text("linkLabel"));let s=document.createElement("button");if(s.type="button",s.className="btn btn-primary",s.textContent=n.text("copyLabel"),s.addEventListener("click",function(){n.copyToClipboard(e,r),s.textContent=n.text("copiedLabel")}),l.appendChild(r),l.appendChild(s),i.appendChild(l),t){let e=document.createElement("p");e.className="neonConfigurator__share__hint",e.textContent=n.text("expiresAt").replace("%date%",n.formatDate(t)),i.appendChild(e)}a.open(n.text("dialogHeadline"),i),r.focus(),r.select()}copyToClipboard(e,t){if(navigator.clipboard&&window.isSecureContext){navigator.clipboard.writeText(e);return}t.select(),document.execCommand("copy")}formatDate(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString()}showMessage(e){let t=document.createElement("p");t.textContent=e,a.open(this.text("dialogHeadline"),t)}text(e){return this.options.texts[e]??""}}}}]);
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.