1(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-25859178"],{"08df":function(t,e,a){},"3abd":function(t,e,a){"use strict";a("6a28")},"6a28":function(t,e,a){},b45f:function(t,e,a){"use strict";a("08df")},d29d:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{"text-align":"center","text-shadow":"1px 1px 2px black"},style:{display:t.oka?"block":"none"}},[e("br"),e("h1",{staticStyle:{"text-decoration":"underline"}},[t._v("MIS CRUCIGRAMAS")]),e("br"),void 0===t.diccionario?e("div",[e("h2",[t._v("Primero debes compilar algun(os) diccionario(s)")])]):e("div",{staticClass:"grid"},[e("label",[t._v("ANCHO:")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.ancho,expression:"ancho",modifiers:{number:!0}}],attrs:{type:"number",min:"5",max:t.anchoMaximo},domProps:{value:t.ancho},on:{focusout:function(e){t.ancho=Math.min(Math.max(t.ancho,5),t.anchoMaximo)},input:function(e){e.target.composing||(t.ancho=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),e("label",[t._v("ALTO:")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.alto,expression:"alto",modifiers:{number:!0}}],attrs:{type:"number",min:"5",max:t.altoMaximo},domProps:{value:t.alto},on:{focusout:function(e){t.alto=Math.min(Math.max(t.alto,5),t.altoMaximo)},input:function(e){e.target.composing||(t.alto=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),e("label",[t._v("PASOS:")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.iteraciones,expression:"iteraciones",modifiers:{number:!0}}],attrs:{min:"1",type:"number"},domProps:{value:t.iteraciones},on:{input:function(e){e.target.composing||(t.iteraciones=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),e("label",[t._v("PALABRAS:")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.palabrasPorIteracion,expression:"palabrasPorIteracion",modifiers:{number:!0}}],attrs:{min:"1",type:"number"},domProps:{value:t.palabrasPorIteracion},on:{input:function(e){e.target.composing||(t.palabrasPorIteracion=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),e("label",[t._v("SOLUCIONES:")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.solucionesPorIteracion,expression:"solucionesPorIteracion",modifiers:{number:!0}}],attrs:{min:"1",type:"number"},domProps:{value:t.solucionesPorIteracion},on:{input:function(e){e.target.composing||(t.solucionesPorIteracion=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),e("label",[t._v("SELECCIÃN:")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.solucionesSeleccionad
1as,expression:"solucionesSeleccionadas",modifiers:{number:!0}}],attrs:{min:"1",type:"number"},domProps:{value:t.solucionesSeleccionadas},on:{input:function(e){e.target.composing||(t.solucionesSeleccionadas=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),e("label",{staticStyle:{cursor:"pointer"},attrs:{for:"bordes"}},[t._v("BORDE:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.bordes,expression:"bordes"}],staticStyle:{height:"1.6rem",cursor:"pointer"},attrs:{id:"bordes",type:"checkbox"},domProps:{checked:Array.isArray(t.bordes)?t._i(t.bordes,null)>-1:t.bordes},on:{change:function(e){var a=t.bordes,i=e.target,o=!!i.checked;if(Array.isArray(a)){var s=null,n=t._i(a,s);i.checked?n<0&&(t.bordes=a.concat([s])):n>-1&&(t.bordes=a.slice(0,n).concat(a.slice(n+1)))}else t.bordes=o}}}),e("input",{directives:[{name:"model",rawName:"v-model",value:t.semilla,expression:"semilla"}],staticStyle:{"grid-column":"span 2","max-width":"calc(100% - 3px) !important"},attrs:{placeholder:"SEMILLA"},domProps:{value:t.semilla},on:{input:function(e){e.target.composing||(t.semilla=e.target.value)}}})]),void 0!==t.diccionario?e("div",[t.proceso?e("button",{staticStyle:{width:"calc(100% - 8px)"},on:{click:t.detener}},[t._v("DETENER")]):t._e(),e("div",{staticStyle:{"text-align":"left",display:"block",border:"1px solid gray",padding:"4px 4px 0",margin:"8px","border-radius":"8px","text-shadow":"none"}},[e("div",{staticStyle:{height:"28px"}},[void 0!==t.matriz?e("button",{staticStyle:{float:"right",position:"relative",top:"-1px","font-size":"16px",padding:"1px 4px",opacity:"1"},on:{click:function(e){return t.compartir()}}},[t._v("COMPARTIR")]):t._e(),t._v(" Hashtags: ")]),e("TagEditor",{ref:"tags",attrs:{allNewValue:!0,newValue:t.newValue,color:"black",colors:["var(--color-select)","var(--color-gradient)"],startChars:"#",fixed:["#"+t.ancho+"x"+t.alto],tagLoad:t.tags,lowerCase:!0}})],1),t.proceso||void 0===t.diccionario?t._e():e("select",{staticStyle:{border:"none:outline:none",padding:"10px","border-radius":"8px"},on:{change:function(e){return t.setTipo(e.target.value)}}},[e("option",{attrs:{value:"1"}},[t._v("NUEVO CRUCIGRAMA")]),e("option",{attrs:{value:"2"}},[t._v("15 CRUCIGRAMAS COMPLETOS")]),e("option",{attrs:{value:"3"}},[t._v("30 CRUCIGRAMAS COMPLETOS")]),e("option",{attrs:{value:"4"}},[t._v("60 CRUCIGRAMAS COMPLETOS")])]),t.proceso||void 0===t.diccionario?t._e():e("button",{staticStyle:{width:"calc(100% - 8px)","font-size":"28px",padding:"8px"},attrs:{disabled:t.ok},on:{click:t.generar}},[e("i",{staticClass:"ti-package",staticStyle:{"font-size":"24px"}}),t._v(" GENERAR ")]),void 0!==t.matriz?e("div",[e("br"),e("h1",[t._v("CRUCIGRAMA GENERADO")])]):t._e(),e("pre",{staticClass:"view-container",staticStyle:{"text-shadow":"none",color:"yellow"},attrs:{id:"cruci"}})]):t._e()])},o=[],s=a("6579"),n=a("e71f"),r=a("2f62"),l=a("6a7c"),c=a("e7ca"),d={name:"Build",props:["id"],components:{TagEditor:c["a"]},data(){return{oka:!1,tags:[],tipo:"1",semilla:"",diccionario:void 0,ancho:8,alto:8,anchoMaximo:50,altoMaximo:50,iteraciones:8,solucionesPorIteracion:12,solucionesSeleccionad
1as:7,palabrasPorIteracion:2,bordes:!0,resp:"",matriz:void 0,proceso:!1}},computed:{ok(){return""===this.ancho||""===this.alto||""===this.iteraciones||""===this.solucionesPorIteracion||""===this.solucionesSeleccionadas||""===this.palabrasPorIteracion},...Object(r["c"])(["uid"])},async mounted(){let t=this.getLocal("buildParams");if(null!==t){let e=JSON.parse(t);this.ancho=e.ancho,this.alto=e.alto,this.iteraciones=e.iteraciones,this.solucionesPorIteracion=e.solucionesPorIteracion,this.solucionesSeleccionadas=e.solucionesSeleccionadas,this.palabrasPorIteracion=e.palabrasPorIteracion,this.bordes=e.bordes,this.semilla=e.semilla}if(t=this.getLocal("buildTags"),null!==t){const e=JSON.parse(t).filter(t=>null===t.match(/^#[0-9]+x[0-9]+$/)).filter(t=>t.length>1);this.tags=e}let e=this.db();if(e){let t=e.transaction("compilacion","readonly"),a=t.objectStore("compilacion"),i=a.get("compilacion");t.oncomplete=()=>{void 0!==i.result?(this.diccionario=i.result.compilacion,console.log("DICCIONARIO LOADED"),this.oka=!0):this.oka=!0}}this.setLoading(!1)},methods:{setTipo(t){this.tipo=t},newValue(t){t=t.filter((t,e)=>e>0),this.tags=t,t=t.filter((e,a)=>t.indexOf(e)===a||null!==e.match(/^#[0-9]+x[0-9]+$/)),this.setLocal("buildTags",JSON.stringify(t))},compartir:async function(){const t=[...this.tags];t.splice(0,0,"#"+this.matriz[0].ancho+"x"+this.matriz[0].alto);const e=Object(n["h"])(),a=Object(l["d"])().currentUser.uid,i=n["a"].now(),o={ancho:this.matriz[0].ancho,alto:this.matriz[0].alto,preguntas:this.matriz[0].preguntasData,uid:a,fecha:i,desc:t};let s=void 0;try{await Object(n["n"])(e,async r=>{const l=Object(n["b"])(e,"crosswords");s=Object(n["d"])(l),await r.set(s,o);const c={desc:t,fecha:i,stars:0,votos:0,plays:0,times:0,timesCount:0,uid:a};s=Object(n["d"])(e,"social",s.id),await r.set(s,c)});s&&(this.tipo,this.playWord(),this.notification("Crucigrama compartido!!"))}catch(r){}},detener:function(){const t=this.getLocal("audio"),e=t?parseInt(t):2;this.playClick(e),this.proceso=!1,this.matriz=void 0,document.getElementById("cruci").innerHTML=""},generar:async function(){this.tags.join(" ").replace(/#/g,"");const t=this.getLocal("audio"),e=t?parseInt(t):2;this.playClick(e);let a=0,i={ancho:this.ancho,alto:this.alto,iteraciones:this.iteraciones,solucionesPorIteracion:this.solucionesPorIteracion,solucionesSeleccionad
1as:this.solucionesSeleccionadas,palabrasPorIteracion:this.palabrasPorIteracion,bordes:this.bordes,semilla:this.semilla};this.setLocal("buildParams",JSON.stringify(i));const o=new s["a"]({compilacion:this.diccionario,ancho:this.ancho,alto:this.alto,palabrasEnBorde:this.bordes?.9:void 0,palabrasPorIteracion:this.palabrasPorIteracion,solucionesPorIteracion:this.solucionesPorIteracion,solucionesSeleccionadas:this.solucionesSeleccionadas});let n=!0;try{while(n){this.proceso=!0,this.matriz=void 0;const t=async t=>{document.getElementById("cruci").innerHTML=t,await this.delay(100)};let e=o.generar(""!==this.semilla?this.semilla:void 0);for(let a=0;a<this.iteraciones;a++){if(!this.proceso)return;e=o.iterar(e),await t(` SEMILLA ${o.semilla} (${a+1}/${this.iteraciones})\n\n`+o.toString(e))}e=o.seleccionarSoluciones(e,1),e=o.completar(e),await t(` SEMILLA ${o.semilla}\n`+o.toString(e,!0)),this.matriz=o.ordenarPreguntas(e);const i=e[0];if("1"===this.tipo)n=!1,console.log(`${a}: ${i.preguntasData.map(t=>t.palabra).join(",")}`),this.compartir();else if(0===i.solas){Math.round(100*i.llenado/i.ancho/i.alto);if("2"===this.tipo){if(o.ignoreWords(i.preguntas),a++,console.log(`${a}: ${i.preguntasData.map(t=>t.palabra).join(",")}`),this.compartir(),a>=15){n=!1;const t=this.getLocal("audio"),e=t?parseInt(t):2;this.playComplete(e)}}else if("3"===this.tipo){if(o.ignoreWords(i.preguntas),a++,console.log(`${a}: ${i.preguntasData.map(t=>t.palabra).join(",")}`),this.compartir(),a>=30){n=!1;const t=this.getLocal("audio"),e=t?parseInt(t):2;this.playComplete(e)}}else if("4"===this.tipo&&(o.ignoreWords(i.preguntas),a++,console.log(`${a}: ${i.preguntasData.map(t=>t.palabra).join(",")}`),this.compartir(),a>=60)){n=!1;const t=this.getLocal("audio"),e=t?parseInt(t):2;this.playComplete(e)}}else console.error("Palabra solas: ",i.solas,"porcentaje: ",i.llenado/i.ancho/i.alto)}}catch(r){return console.log(r),void this.notification({message:"No se pudo completar el crucigrama, revise la consola",type:"error"})}this.proceso=!1}}},u=d,h=(a("3abd"),a("2877")),p=Object(h["a"])(u,i,o,!1,null,null,null);e["default"]=p.exports},e7ca:function(t,e,a){"use strict";var i=function(){var t=this,e=t._self._c;return e("div",[e("div",{ref:"editor",staticClass:"tag-editor",on:{click:function(e){return e.stopPropagation(),t.add("",e)}}},[!0===t.editable?e("span",{staticStyle:{cursor:"pointer",width:"24px","text-align":"center"},attrs:{tabindex:"-1"},on:{click:function(e){return e.stopPropagation(),t.add("")}}},[t._v(t._s(t.search?"ðï¸":"+"))]):t._e(),t._l(t.tags,(function(a,i){return e("span",{key:i,style:{cursor:"pointer !important",background:t.colors[Math.max(0,t.startChars.indexOf(a.length>0?a.charAt(0):t.startChars.charAt(0)))]},attrs:{tabindex:"-1"},on:{click:function(e){return e.stopPropagation(),t.click(e)}}},[i>=t.fixed.length?e("label",{style:{cursor:!t.editable&&t.clickMethod?"pointer":"text",outline:"none",textTransform:t.upperCase?"uppercase":t.lowerCase?"lowercase":"none"},attrs:{autocorrect:"off",autocapitalize:"off",spellcheck:"false",contenteditable:!0===t.editable},on:{click:function(e){return e.stopPropagation(),t.tagClick(e,a)},keydown:[function(e){return t.keydown(e,i)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.newValueInternal.apply(null,arguments)}],blur:function(e){return t.focus(e,i)},input:function(e){return t.change(e.target,i)}}},[t._v(t._s(a))]):e("label",{key:t.key,style:{cursor:!t.editable&&t.clickMethod?"pointer":"text",outline:"none",textTransform:t.upperCase?"uppercase":t.lowerCase?"lowercase":"none"},attrs:{tabindex:"-1"},on:{click:function(e){return e.stopPropagation(),t.tagClick(e,a)}}},[t._v(" "+t._s(a)+" ")]),i>=t.fixed.length&&!0===t.editable?e("button",{attrs:{tabindex:"-1"},on:{click:function(e){return e.stopPropagation(),t.del(i)}}},[t._v("x")]):t._e()])}))],2)])},o=[];let s="";var n={name:"TagEditor",data(){return{tags:void 0,key:0}},props:{allNewValue:{type:Boolean,default:!1},newValue:{type:Function,default:t=>{}},color:{type:String,default:"white"},clickMethod:{type:Function,default:void 0},editable:{default:!0},tagLoad:{type:Array,default:()=>[]},maxTags:{type:Number,default:6},fixed:{type:Array,default:()=>[]},search:{default:!1},upperCase:{default:!1},lowerCase:{default:!1},validChars:{default:"01234567890QWERTYUIOPASDFGHJKLÃZXCVBNM_"},startChars:{default:"#@"},colors:{type:Array,default:()=>["blue","red"]}},watch:{fixed:{handler:function(){this.fixed.join()!==s&&(this.handler(),this.tags=this.tags.filter(t=>t.length>1),s=this.fixed.join())},immediate:!0},tagLoad:{handler:function(){this.handler()},deep:!0}},created(){this.tagLoad&&(this.tags=[...this.fixed,...this.tagLoad].map(t=>this.upperCase?t.toUpperCase():this.lowerCase?t.toLowerCase():t))},methods:{handler(){this.tagLoad?this.tags=[...this.fixed,...this.tagLoad].map(t=>this.upperCase?t.toUpperCase():this.lowerCase?t.toLowerCase():t):this.tags=[...this.fixed].map(t=>this.upperCase?t.toUpperCase():this.lowerCase?t.toLowerCase():t),this.key++},isDescendant(t,e){var a=e.parentNode;
1while(null!=a){if(a==t)return!0;a=a.parentNode}return!1},tagClick(t,e){!this.editable&&this.clickMethod&&(this.clickMethod(e),t.stopPropagation(),t.preventDefault())},keydown(t,e){"Backspace"===t.key&&""===t.target.innerText?(this.del(e),t.preventDefault(),t.target.blur()):"Enter"===t.key&&(t.preventDefault(),t.target.blur())},newValueInternal(){void 0!==this.tags&&this.newValue(this.tags)},del(t){this.tags.splice(t,1),this.newValueInternal();for(let e=0;e<this.tags.length;e++)this.$refs.editor.children[e+1].children[0].innerText=this.tags[e];this.tags.length>0&&setTimeout(()=>{if(void 0!==this.$refs.editor){const a=this.$refs.editor.children[t].children[0];try{a.focus()}catch(e){}try{const e=document.createRange();e.selectNodeContents(a),e.setStart(a.childNodes[0],this.tags[t-1].length),e.setEnd(a.childNodes[0],this.tags[t-1].length);const i=window.getSelection();i.removeAllRanges(),i.addRange(e)}catch(e){}}},50)},click(t){if(!0===this.editable){const e=t.target;"SPAN"===e.nodeName&&e.childNodes[0].focus(),t.preventDefault()}},add(t,e){let a=this.tags.indexOf("");a=-1===a?this.tags.indexOf(this.startChars.charAt(0)):a,""===t&&a>-1?this.$refs.editor.children[a+1].children[0].focus():!0===this.editable&&this.tags.length<this.maxTags?(this.tags.push(t),this.$nextTick(()=>{const e=this.$refs.editor.lastChild.childNodes[0];e.focus(),""!==t&&this.change(e,this.tags.length-1),this.$forceUpdate()})):!0===this.editable?this.notification("Son "+this.maxTags+" etiquetas como máximo"):(e.preventDefault(),e.stopPropagation())},focus(t,e){const a=t.target;if(1===a.innerText.trim().length&&0===this.startChars.indexOf(a.innerText.trim())||""===a.innerText){this.tags.splice(e,1);document.activeElement}},change(t,e){if(this.editable&&e>=this.fixed.length){let a=(this.upperCase?t.innerText.toUpperCase():this.lowerCase?t.innerText.toLowerCase():t.innerText).replace(/(\n|\r)*/gm,""),i=window.getSelection().getRangeAt(0).startOffset;-1===this.startChars.indexOf(a.charAt(0))&&(i++,a=this.startChars.charAt(0)+a),a=a.replace(" "," ");const o=a.indexOf(" ");let s=-1===o?[a]:[a.substring(0,o),a.substring(o+1)],n=s.length>1&&""===s[1]&&this.startChars.indexOf(s[0])>-1;n&&(s=s.filter(t=>""!==t)),a=s[0];let r="";for(let t=0;t<a.length;t++){let e=a.charAt(t).toUpperCase();(this.validChars.toUpperCase().indexOf(e)>-1||0===t&&this.startChars.toUpperCase().indexOf(e)>-1)&&(r+=a.charAt(t))}if(t.innerText=r,r.length>0&&(i=i+r.length-a.length,i>r.length&&(i=r.length),i>=0)){const e=document.createRange();e.selectNodeContents(t),e.setStart(t.childNodes[0],i),e.setEnd(t.childNodes[0],i);const a=window.getSelection();a.removeAllRanges(),a.addRange(e)}this.tags[e]=r,this.$forceUpdate();for(let t=1;t<s.length;t++)this.add(s[t]);this.allNewValue&&this.newValueInternal()}}}},r=n,l=(a("b45f"),a("2877")),c=Object(l["a"])(r,i,o,!1,null,"9482c9e6",null);e["a"]=c.exports}}]); 2//# sourceMappingURL=chunk-25859178.0637e2cf.js.map
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.