1window.JSBUILD='2026-10-08 21:45';Promise.withResolvers??=function(){let a,b;return{promise:new Promise((x,y)=>{a=x,b=y}),resolve:a,reject:b}}; 2import{a as l}from"../chunk-HI4LWL6W.js";var I;async function Q(e,a){j(e,a)}l(Q,"create");var p,m,y,c,S="playZone",o={},k;async function j(e,a){if(c=a||{},e===p)return;p&&x(),p=e;let t=e.vgame.game,i=t.ext.auction_center,n=i?.holder,r=n&&n.parentElement!==t.playZone&&n.parentElement||null;t.isPreview=!0;let s=c.onehand,g=c.onehand>=0;if(y=e.makeTitle(g?"move":null),i&&!i.isdone?y="":y="{Yourmove}",c.mode==="puzzle"&&s===e.contract.declarer&&(y=`{Dowincontract} ${e.contract.shorttext}`),m={pov:t.pov,nonames:t.playArea.classList.contains("nonames"),bigstate:t.bigState,auctionParent:r,auctionManual:i?.manualVisible,auctionMaxHeight:n?.style.maxHeight,tray:i?.isTray},o={},s>=0||(s=e.next),g){for(let d=e.maxplayers;d--;)e.setOpened(d,d===c.onehand||c.opened?.includes(d));t.setpov(s),e.sendHands()}if(c.onehand>=0&&(t.cardHolder[c.onehand].forceMultiLine(),t.cardHolder[(c.onehand+2)%4].forceMultiLine()),r&&t.playZone.appendChild(n),t.playArea.classList.add("preview","skipdragmove"),LOCALTEST||t.playArea.classList.add("nopointerevents"),t.setNoNames(!0),i){i.isdone||i.addQuestion(),i.toggleTray(!1),i.toggleShow(!0);let d=[a?.vulnerable,a?.scoring,y].filter(f=>!!f).join(". ");i.showCaption(d),n.style.maxHeight="initial"}t[S].style.transition="transform 0.2s",t.previewTitle||=html(`<div class='previewtitle previewonly hideempty blackonwhite' 3 style='order: -1; align-self: stretch; text-align: center; padding: 0.2em 0;'></div>`,t.playZone),t.previewTitle.setContent(y),t.previewControl||=html(`<div class='previewcontrol buttonsline display_none flexline nowrap center' 4 style='align-self: stretch; justify-self: stretch; background: var( --color-canvas ); z-index: 10000;'> 5 <button class='_display_none' data-action='publish'>{Publish}</button> 6 <span class='icon grayhover' data-action='share'>ð</span> 7 <button class='display_none' data-action='copy'>ð Copy</button> 8 <span class='icon grayhover' data-action='cancel'>âï¸</button> 9 `,t.statusBar.$(".statusline"),J);let w=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent);t.previewControl.$('[data-action="share"]').makeVisible(w),t.previewControl.show(),o.promise=Y(t,a)}l(j,"preview");var z=l(e=>new Promise((a,t)=>{let i=new Image;i.onload=()=>a(i),i.onerror=t,i.src=e}),"loadImage"),N=l((e,a="image/png",t=1)=>new Promise(i=>{e.toBlob(n=>i(n),a,t)}),"getBlob");function O(e){let a;for(let t of e.playZone.$$(".auction_box.centered, .solid_card.visible")){if(!t.checkVisibility({opacityProperty:!0,visibilityProperty:!0}))continue;let i=t.getBoundingClientRect();a||(a=i.toJSON()),i.left<a.left&&(a.left=i.left),i.right>a.right&&(a.right=i.right),i.top<a.top&&(a.top=i.top),i.bottom>a.bottom&&!t.closest(".auction_box")&&(a.bottom=i.bottom)}return a}l(O,"findCropRect");function M(e,a,t,i,n,r,s){a.style.cssText+=`position: absolute; translate: ${r}px ${s}px; 10 width: ${i}px; height: ${n}px; 11 transition: all .5s linear; border-radius: 5px;`,o.temp=html("<div class='abs100 tempcanvas' style='position: relative; transition: all .5s linear; background: transparent; z-index:10000'></div>",e.playZone),o.temp.appendChild(a),requestAnimationFrame(()=>{o.temp.style.background="black",a.style.translate=`${(t.width-i)/2}px ${(t.height-n)/2}px`})}l(M,"showCropPreview");async function W(e){let[{getScreenshotableWindows:a,getWindowScreenshot:t},{getCurrentWindow:i},{convertFileSrc:n}]=await Promise.all([import("tauri-plugin-screenshots-api"),import("@tauri-apps/api/window"),import("@tauri-apps/api/core")]),r=i(),[s,g,w,d,f]=await Promise.all([r.scaleFactor(),r.title(),r.outerPosition(),r.innerPosition(),a()]),b=f.find(q=>q.title===g)||f[0];if(!b)return;let v=await t(b.id),h=await z(n(v)),A=d.x-w.x,R=d.y-w.y,C=e.playZone.getBoundingClientRect(),u=O(e);if(!u)return;let $=u.right-u.left+10,E=u.bottom-u.top+10,Z=u.left-C.left-5,B=u.top-C.top-5,P=$*s,T=E*s,D=A+(u.left-5)*s,F=R+(u.top-5)*s,L=html(`<canvas width='${P}' height='${T}'></canvas>`);return L.getContext("2d").drawImage(h,D,F,P,T,0,0,P,T),M(e,L,C,$,E,Z,B),o.blob=await N(L),o.blob?o:void 0}l(W,"makeImageTauri");async function Y(e,a){if(window.isTauri)try{return await W(e,a)}catch(t){if(log(t),LOCALTEST)debugger;return}I||=await import("https://cdn.jsdelivr.net/npm/[email protected]/+esm"),await sleep(1e3),await new Promise(t=>requestAnimationFrame(()=>setTimeout(t,0)));try{let t=window.devicePixelRatio||1,i=await I.toCanvas(e.playZone,{skipFonts:!0,fontEmbedCSS:"",quality:1,cacheBust:!0,pixelRatio:t,filter:h=>
11{if(["SCRIPT","STYLE","NOSCRIPT","IFRAME"].includes(h.tagName)||h.src)return!1;if(h.nodeType===Node.TEXT_NODE||h.nodeType===Node.COMMENT_NODE)return!0;if(!(h instanceof Element)){if(LOCALTEST)debugger;return}return!getComputedStyle(h).backgroundImage.includes(".svg")}}),n=e.playZone.getBoundingClientRect(),r=O(e);if(!r)return;let s=r.right-r.left+10,g=r.bottom-r.top+10,w=r.left-n.left-5,d=r.top-n.top-5,f=s*t,b=g*t,v=html(`<canvas width='${f}' height='${b}'></canvas>`);return v.getContext("2d").drawImage(i,w*t,d*t,f,b,0,0,f,b),M(e,v,n,s,g,w,d),o.blob=await N(v||i),o.blob?o:void 0}catch(t){if(log(t),LOCALTEST)debugger}}l(Y,"makeImage");async function J(e){if(!p)return;let a=e.target.closest("[data-action]")?.dataset.action,t=p;if(k=t.makeShareUrl({mode:c.mode,me:t.vgame.game.pov}),a==="publish")return V(e);a==="copy"?H():a==="share"?U(k):x()}l(J,"previewClick");async function U(e){await o.promise;let a=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent),t=new File([o.blob],"screenshot.png",{type:o.blob.type});if(!a||!navigator.canShare({files:[t]})){H();return}try{await navigator.share({files:[t],title:"Problem",text:"Solve it!"})}catch(i){i.name!=="AbortError"&&log(`navigator.share error${i}`)}if(!e){let i=solo.json({oneview:"next"});delete i.players,delete i.boardno,i.scoring=solo.initData.scoring,solo.initData.ismatch&&(i.ismatch=!0),i.mode="move",log(JSON.stringify(i));let n=await API("/uniq/put",{public:i});log("Result of put: "+n?.uniq),n?.ok&&(e="/"+n.uniq)}if(e){let i="https://www.neobridge.eu",n=await(await import("./inv.js")).invite({action:"shareurl",title:y,url:`${i}${e}`})}x()}l(U,"share");async function H(){try{let e={[o.blob.type]:o.blob},a=[new ClipboardItem(e)],t=await navigator.clipboard.write(a);toast("Copied to clipboard"),o.temp?.puff?.({scale:"1.1"});return}catch{if(LOCALTEST)debugger}}l(H,"copy");function x(){if(!p)return;o?.promise.then(()=>o.temp?.remove());for(let t=p.maxplayers;t--;)p.setOpened(t,!0);p.sendHands();let e=p.vgame.game;e.setpov(m.pov),e.route_bigstate(m.bigstate),e.isPreview=!1,e[S].style.transform="",e[S].style.transition="",e.previewControl.hide(),e.playArea.classList.remove("skipdragmove"),e.playArea.classList.remove("preview"),e.playArea.classList.remove("nopointerevents"),e.cardHolder[c.onehand]?.forceMultiLine(!1),e.cardHolder[(c.onehand+2)%4]?.forceMultiLine(!1),e.setNoNames(m.nonames);let a=e.ext.auction_center;a&&(a.removeQuestion(),a.toggleTray(m.tray),a.toggleShow(m.auctionManual),a.showCaption(),a.holder.style.maxHeight=m.auctionMaxHeight),m.auctionParent?.appendChild(e.ext.auction_center.holder),p=null}l(x,"cancelPreview");document.addEventListener("keydown",e=>{if(p&&e.key==="Escape"){e.preventDefault(),e.stopPropagation(),x();return}});async function V(e){await checkAuth(),e.target.setSpinner(!0);let a=k,{data:t,error:i}=await supabase.rpc("publish_post",{p_content:p.getJSON({mode:c.mode,me:"pov"}),p_hidden_content:{},p_unlock_type:"solution",p_hash:a}),n=t;i?(log(`problemcreator: supa error ${i.message}`),i.startsWith("DUPLICATE:")&&(toast("You alredy published this"),[_,n]=i.match(/DUPLICATE: .*/))):toast(`Published with id ${t}`),e.target.setSpinner(!1),x(),n&&navigate(`p/${n}`)}l(V,"publish");export{Q as create};
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.