@limrun/ui 0.9.0-rc.14 → 0.9.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/components/remote-control.d.ts +125 -1
  2. package/dist/core/device-install/apple/provisioning.d.ts +55 -4
  3. package/dist/core/device-install/operations/limbuild-client.d.ts +15 -1
  4. package/dist/core/device-install/storage/browser-storage.d.ts +9 -5
  5. package/dist/core/device-install/types.d.ts +4 -1
  6. package/dist/device-install/index.cjs +1 -1
  7. package/dist/device-install/index.js +70 -64
  8. package/dist/device-install/react.cjs +1 -1
  9. package/dist/device-install/react.js +1 -1
  10. package/dist/device-install-dialog-DY35un0b.js +9 -0
  11. package/dist/device-install-dialog-chNLeiiL.mjs +2000 -0
  12. package/dist/device-install-dialog.css +1 -1
  13. package/dist/hooks/use-device-install.d.ts +5 -1
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.js +1286 -1116
  16. package/dist/use-device-install-BIrl0v-k.js +31 -0
  17. package/dist/{use-device-install-sDVvby1V.mjs → use-device-install-LGfEdqyM.mjs} +4388 -4271
  18. package/package.json +4 -2
  19. package/src/components/device-install/device-install-dialog.css +29 -0
  20. package/src/components/device-install/device-install-dialog.tsx +91 -30
  21. package/src/components/remote-control.tsx +535 -5
  22. package/src/core/device-install/apple/provisioning.test.ts +84 -0
  23. package/src/core/device-install/apple/provisioning.ts +91 -7
  24. package/src/core/device-install/operations/limbuild-client.ts +32 -2
  25. package/src/core/device-install/storage/browser-storage.ts +29 -14
  26. package/src/core/device-install/types.ts +5 -1
  27. package/src/hooks/use-device-install.ts +135 -59
  28. package/dist/device-install-dialog-CjH25hnN.js +0 -2
  29. package/dist/device-install-dialog-W5Xv9kWL.mjs +0 -443
  30. package/dist/use-device-install-Y1u6vIBB.js +0 -31
@@ -0,0 +1,9 @@
1
+ "use strict";require('./device-install-dialog.css');const u=require("react/jsx-runtime"),T=require("react"),Xe=require("./use-device-install-BIrl0v-k.js");function et(i){var r,s,t="";if(typeof i=="string"||typeof i=="number")t+=i;else if(typeof i=="object")if(Array.isArray(i)){var e=i.length;for(r=0;r<e;r++)i[r]&&(s=et(i[r]))&&(t&&(t+=" "),t+=s)}else for(s in i)i[s]&&(t&&(t+=" "),t+=s);return t}function q(){for(var i,r,s=0,t="",e=arguments.length;s<e;s++)(i=arguments[s])&&(r=et(i))&&(t&&(t+=" "),t+=r);return t}var z={},W,Se;function at(){return Se||(Se=1,W=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),W}var Z={},U={},Ae;function k(){if(Ae)return U;Ae=1;let i;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return U.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17},U.getSymbolTotalCodewords=function(t){return r[t]},U.getBCHDigit=function(s){let t=0;for(;s!==0;)t++,s>>>=1;return t},U.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');i=t},U.isKanjiModeEnabled=function(){return typeof i<"u"},U.toSJIS=function(t){return i(t)},U}var X={},Ee;function Ce(){return Ee||(Ee=1,(function(i){i.L={bit:1},i.M={bit:0},i.Q={bit:3},i.H={bit:2};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"l":case"low":return i.L;case"m":case"medium":return i.M;case"q":case"quartile":return i.Q;case"h":case"high":return i.H;default:throw new Error("Unknown EC Level: "+s)}}i.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4},i.from=function(t,e){if(i.isValid(t))return t;try{return r(t)}catch{return e}}})(X)),X}var ee,Be;function ct(){if(Be)return ee;Be=1;function i(){this.buffer=[],this.length=0}return i.prototype={get:function(r){const s=Math.floor(r/8);return(this.buffer[s]>>>7-r%8&1)===1},put:function(r,s){for(let t=0;t<s;t++)this.putBit((r>>>s-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const s=Math.floor(this.length/8);this.buffer.length<=s&&this.buffer.push(0),r&&(this.buffer[s]|=128>>>this.length%8),this.length++}},ee=i,ee}var te,Ie;function ut(){if(Ie)return te;Ie=1;function i(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return i.prototype.set=function(r,s,t,e){const n=r*this.size+s;this.data[n]=t,e&&(this.reservedBit[n]=!0)},i.prototype.get=function(r,s){return this.data[r*this.size+s]},i.prototype.xor=function(r,s,t){this.data[r*this.size+s]^=t},i.prototype.isReserved=function(r,s){return this.reservedBit[r*this.size+s]},te=i,te}var ne={},Pe;function dt(){return Pe||(Pe=1,(function(i){const r=k().getSymbolSize;i.getRowColCoords=function(t){if(t===1)return[];const e=Math.floor(t/7)+2,n=r(t),o=n===145?26:Math.ceil((n-13)/(2*e-2))*2,a=[n-7];for(let l=1;l<e-1;l++)a[l]=a[l-1]-o;return a.push(6),a.reverse()},i.getPositions=function(t){const e=[],n=i.getRowColCoords(t),o=n.length;for(let a=0;a<o;a++)for(let l=0;l<o;l++)a===0&&l===0||a===0&&l===o-1||a===o-1&&l===0||e.push([n[a],n[l]]);return e}})(ne)),ne}var ie={},je;function ft(){if(je)return ie;je=1;const i=k().getSymbolSize,r=7;return ie.getPositions=function(t){const e=i(t);return[[0,0],[e-r,0],[0,e-r]]},ie}var re={},Re;function ht(){return Re||(Re=1,(function(i){i.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};i.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},i.from=function(e){return i.isValid(e)?parseInt(e,10):void 0},i.getPenaltyN1=function(e){const n=e.size;let o=0,a=0,l=0,h=null,p=null;for(let N=0;N<n;N++){a=l=0,h=p=null;for(let v=0;v<n;v++){let g=e.get(N,v);g===h?a++:(a>=5&&(o+=r.N1+(a-5)),h=g,a=1),g=e.get(v,N),g===p?l++:(l>=5&&(o+=r.N1+(l-5)),p=g,l=1)}a>=5&&(o+=r.N1+(a-5)),l>=5&&(o+=r.N1+(l-5))}return o},i.getPenaltyN2=function(e){const n=e.size;let o=0;for(let a=0;a<n-1;a++)for(let l=0;l<n-1;l++){const h=e.get(a,l)+e.get(a,l+1)+e.get(a+1,l)+e.get(a+1,l+1);(h===4||h===0)&&o++}return o*r.N2},i.getPenaltyN3=function(e){const n=e.size;let o=0,a=0,l=0;for(let h=0;h<n;h++){a=l=0;for(let p=0;p<n;p++)a=a<<1&2047|e.get(h,p),p>=10&&(a===1488||a===93)&&o++,l=l<<1&2047|e.get(p,h),p>=10&&(l===1488||l===93)&&o++}return o*r.N3},i.getPenaltyN4=function(e){let n=0;const o=e.data.length;for(let l=0;l<o;l++)n+=e.data[l];return Math.abs(Math.ceil(n*100/o/5)-10)*r.N4};function s(t,e,n){switch(t){case i.Patterns.PATTERN000:return(e+n)%2===0;case i.Patterns.PATTERN001:return e%2===0;case i.Patterns.PATTERN010:return n%3===0;case i.Patterns.PATTERN011:return(e+n)%3===0;case i.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case i.Patterns.PATTERN101:return e*n%2+e*n%3===0;case i.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case i.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}i.applyMask=function(e,n){const o=n.size;for(let a=0;a<o;a++)for(let l=0;l<o;l++)n.isReserved(l,a)||n.xor(l,a,s(e,l,a))},i.getBestMask=function(e,n){const o=Object.keys(i.Patterns).length;let a=0,l=1/0;for(let h=0;h<o;h++){n(h),i.applyMask(h,e);const p=i.getPenaltyN1(e)+i.getPenaltyN2(e)+i.getPenaltyN3(e)+i.getPenaltyN4(e);i.applyMask(h,e),p<l&&(l=p,a=h)}return a}})(re)),re}var J={},Te;function tt(){if(Te)return J;Te=1;const i=Ce(),r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return J.getBlocksCount=function(e,n){switch(n){case i.L:return r[(e-1)*4+0];case i.M:return r[(e-1)*4+1];case i.Q:return r[(e-1)*4+2];case i.H:return r[(e-1)*4+3];default:return}},J.getTotalCodewordsCount=function(e,n){switch(n){case i.L:return s[(e-1)*4+0];case i.M:return s[(e-1)*4+1];case i.Q:return s[(e-1)*4+2];case i.H:return s[(e-1)*4+3];default:return}},J}var se={},K={},Me;function gt(){if(Me)return K;Me=1;const i=new Uint8Array(512),r=new Uint8Array(256);return(function(){let t=1;for(let e=0;e<255;e++)i[e]=t,r[t]=e,t<<=1,t&256&&(t^=285);for(let e=255;e<512;e++)i[e]=i[e-255]})(),K.log=function(t){if(t<1)throw new Error("log("+t+")");return r[t]},K.exp=function(t){return i[t]},K.mul=function(t,e){return t===0||e===0?0:i[r[t]+r[e]]},K}var xe;function pt(){return xe||(xe=1,(function(i){const r=gt();i.mul=function(t,e){const n=new Uint8Array(t.length+e.length-1);for(let o=0;o<t.length;o++)for(let a=0;a<e.length;a++)n[o+a]^=r.mul(t[o],e[a]);return n},i.mod=function(t,e){let n=new Uint8Array(t);for(;n.length-e.length>=0;){const o=n[0];for(let l=0;l<e.length;l++)n[l]^=r.mul(e[l],o);let a=0;for(;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n},i.generateECPolynomial=function(t){let e=new Uint8Array([1]);for(let n=0;n<t;n++)e=i.mul(e,new Uint8Array([1,r.exp(n)]));return e}})(se)),se}var oe,De;function mt(){if(De)return oe;De=1;const i=pt();function r(s){this.genPoly=void 0,this.degree=s,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},r.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const n=i.mod(e,this.genPoly),o=this.degree-n.length;if(o>0){const a=new Uint8Array(this.degree);return a.set(n,o),a}return n},oe=r,oe}var le={},ae={},ce={},Le;function nt(){return Le||(Le=1,ce.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),ce}var M={},Ue;function it(){if(Ue)return M;Ue=1;const i="[0-9]+",r="[A-Z $%*+\\-./:]+";let s="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";s=s.replace(/u/g,"\\u");const t="(?:(?![A-Z0-9 $%*+\\-./:]|"+s+`)(?:.|[\r
2
+ ]))+`;M.KANJI=new RegExp(s,"g"),M.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),M.BYTE=new RegExp(t,"g"),M.NUMERIC=new RegExp(i,"g"),M.ALPHANUMERIC=new RegExp(r,"g");const e=new RegExp("^"+s+"$"),n=new RegExp("^"+i+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return M.testKanji=function(l){return e.test(l)},M.testNumeric=function(l){return n.test(l)},M.testAlphanumeric=function(l){return o.test(l)},M}var qe;function F(){return qe||(qe=1,(function(i){const r=nt(),s=it();i.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},i.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},i.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},i.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},i.MIXED={bit:-1},i.getCharCountIndicator=function(n,o){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!r.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?n.ccBits[0]:o<27?n.ccBits[1]:n.ccBits[2]},i.getBestModeForData=function(n){return s.testNumeric(n)?i.NUMERIC:s.testAlphanumeric(n)?i.ALPHANUMERIC:s.testKanji(n)?i.KANJI:i.BYTE},i.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},i.isValid=function(n){return n&&n.bit&&n.ccBits};function t(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return i.NUMERIC;case"alphanumeric":return i.ALPHANUMERIC;case"kanji":return i.KANJI;case"byte":return i.BYTE;default:throw new Error("Unknown mode: "+e)}}i.from=function(n,o){if(i.isValid(n))return n;try{return t(n)}catch{return o}}})(ae)),ae}var ke;function vt(){return ke||(ke=1,(function(i){const r=k(),s=tt(),t=Ce(),e=F(),n=nt(),o=7973,a=r.getBCHDigit(o);function l(v,g,E){for(let B=1;B<=40;B++)if(g<=i.getCapacity(B,E,v))return B}function h(v,g){return e.getCharCountIndicator(v,g)+4}function p(v,g){let E=0;return v.forEach(function(B){const R=h(B.mode,g);E+=R+B.getBitsLength()}),E}function N(v,g){for(let E=1;E<=40;E++)if(p(v,E)<=i.getCapacity(E,g,e.MIXED))return E}i.from=function(g,E){return n.isValid(g)?parseInt(g,10):E},i.getCapacity=function(g,E,B){if(!n.isValid(g))throw new Error("Invalid QR Code version");typeof B>"u"&&(B=e.BYTE);const R=r.getSymbolTotalCodewords(g),c=s.getTotalCodewordsCount(g,E),P=(R-c)*8;if(B===e.MIXED)return P;const S=P-h(B,g);switch(B){case e.NUMERIC:return Math.floor(S/10*3);case e.ALPHANUMERIC:return Math.floor(S/11*2);case e.KANJI:return Math.floor(S/13);case e.BYTE:default:return Math.floor(S/8)}},i.getBestVersionForData=function(g,E){let B;const R=t.from(E,t.M);if(Array.isArray(g)){if(g.length>1)return N(g,R);if(g.length===0)return 1;B=g[0]}else B=g;return l(B.mode,B.getLength(),R)},i.getEncodedBits=function(g){if(!n.isValid(g)||g<7)throw new Error("Invalid QR Code version");let E=g<<12;for(;r.getBCHDigit(E)-a>=0;)E^=o<<r.getBCHDigit(E)-a;return g<<12|E}})(le)),le}var ue={},Fe;function wt(){if(Fe)return ue;Fe=1;const i=k(),r=1335,s=21522,t=i.getBCHDigit(r);return ue.getEncodedBits=function(n,o){const a=n.bit<<3|o;let l=a<<10;for(;i.getBCHDigit(l)-t>=0;)l^=r<<i.getBCHDigit(l)-t;return(a<<10|l)^s},ue}var de={},fe,He;function yt(){if(He)return fe;He=1;const i=F();function r(s){this.mode=i.NUMERIC,this.data=s.toString()}return r.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let e,n,o;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),o=parseInt(n,10),t.put(o,10);const a=this.data.length-e;a>0&&(n=this.data.substr(e),o=parseInt(n,10),t.put(o,a*3+1))},fe=r,fe}var he,ze;function Ct(){if(ze)return he;ze=1;const i=F(),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s(t){this.mode=i.ALPHANUMERIC,this.data=t}return s.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let o=r.indexOf(this.data[n])*45;o+=r.indexOf(this.data[n+1]),e.put(o,11)}this.data.length%2&&e.put(r.indexOf(this.data[n]),6)},he=s,he}var ge,Ve;function bt(){if(Ve)return ge;Ve=1;const i=F();function r(s){this.mode=i.BYTE,typeof s=="string"?this.data=new TextEncoder().encode(s):this.data=new Uint8Array(s)}return r.getBitsLength=function(t){return t*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){for(let t=0,e=this.data.length;t<e;t++)s.put(this.data[t],8)},ge=r,ge}var pe,Ke;function _t(){if(Ke)return pe;Ke=1;const i=F(),r=k();function s(t){this.mode=i.KANJI,this.data=t}return s.getBitsLength=function(e){return e*13},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=r.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}},pe=s,pe}var me={exports:{}},Oe;function Nt(){return Oe||(Oe=1,(function(i){var r={single_source_shortest_paths:function(s,t,e){var n={},o={};o[t]=0;var a=r.PriorityQueue.make();a.push(t,0);for(var l,h,p,N,v,g,E,B,R;!a.empty();){l=a.pop(),h=l.value,N=l.cost,v=s[h]||{};for(p in v)v.hasOwnProperty(p)&&(g=v[p],E=N+g,B=o[p],R=typeof o[p]>"u",(R||B>E)&&(o[p]=E,a.push(p,E),n[p]=h))}if(typeof e<"u"&&typeof o[e]>"u"){var c=["Could not find a path from ",t," to ",e,"."].join("");throw new Error(c)}return n},extract_shortest_path_from_predecessor_list:function(s,t){for(var e=[],n=t;n;)e.push(n),s[n],n=s[n];return e.reverse(),e},find_path:function(s,t,e){var n=r.single_source_shortest_paths(s,t,e);return r.extract_shortest_path_from_predecessor_list(n,e)},PriorityQueue:{make:function(s){var t=r.PriorityQueue,e={},n;s=s||{};for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e.queue=[],e.sorter=s.sorter||t.default_sorter,e},default_sorter:function(s,t){return s.cost-t.cost},push:function(s,t){var e={value:s,cost:t};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};i.exports=r})(me)),me.exports}var Je;function St(){return Je||(Je=1,(function(i){const r=F(),s=yt(),t=Ct(),e=bt(),n=_t(),o=it(),a=k(),l=Nt();function h(c){return unescape(encodeURIComponent(c)).length}function p(c,P,S){const f=[];let j;for(;(j=c.exec(S))!==null;)f.push({data:j[0],index:j.index,mode:P,length:j[0].length});return f}function N(c){const P=p(o.NUMERIC,r.NUMERIC,c),S=p(o.ALPHANUMERIC,r.ALPHANUMERIC,c);let f,j;return a.isKanjiModeEnabled()?(f=p(o.BYTE,r.BYTE,c),j=p(o.KANJI,r.KANJI,c)):(f=p(o.BYTE_KANJI,r.BYTE,c),j=[]),P.concat(S,f,j).sort(function(y,w){return y.index-w.index}).map(function(y){return{data:y.data,mode:y.mode,length:y.length}})}function v(c,P){switch(P){case r.NUMERIC:return s.getBitsLength(c);case r.ALPHANUMERIC:return t.getBitsLength(c);case r.KANJI:return n.getBitsLength(c);case r.BYTE:return e.getBitsLength(c)}}function g(c){return c.reduce(function(P,S){const f=P.length-1>=0?P[P.length-1]:null;return f&&f.mode===S.mode?(P[P.length-1].data+=S.data,P):(P.push(S),P)},[])}function E(c){const P=[];for(let S=0;S<c.length;S++){const f=c[S];switch(f.mode){case r.NUMERIC:P.push([f,{data:f.data,mode:r.ALPHANUMERIC,length:f.length},{data:f.data,mode:r.BYTE,length:f.length}]);break;case r.ALPHANUMERIC:P.push([f,{data:f.data,mode:r.BYTE,length:f.length}]);break;case r.KANJI:P.push([f,{data:f.data,mode:r.BYTE,length:h(f.data)}]);break;case r.BYTE:P.push([{data:f.data,mode:r.BYTE,length:h(f.data)}])}}return P}function B(c,P){const S={},f={start:{}};let j=["start"];for(let d=0;d<c.length;d++){const y=c[d],w=[];for(let m=0;m<y.length;m++){const A=y[m],C=""+d+m;w.push(C),S[C]={node:A,lastCount:0},f[C]={};for(let _=0;_<j.length;_++){const b=j[_];S[b]&&S[b].node.mode===A.mode?(f[b][C]=v(S[b].lastCount+A.length,A.mode)-v(S[b].lastCount,A.mode),S[b].lastCount+=A.length):(S[b]&&(S[b].lastCount=A.length),f[b][C]=v(A.length,A.mode)+4+r.getCharCountIndicator(A.mode,P))}}j=w}for(let d=0;d<j.length;d++)f[j[d]].end=0;return{map:f,table:S}}function R(c,P){let S;const f=r.getBestModeForData(c);if(S=r.from(P,f),S!==r.BYTE&&S.bit<f.bit)throw new Error('"'+c+'" cannot be encoded with mode '+r.toString(S)+`.
4
+ Suggested mode is: `+r.toString(f));switch(S===r.KANJI&&!a.isKanjiModeEnabled()&&(S=r.BYTE),S){case r.NUMERIC:return new s(c);case r.ALPHANUMERIC:return new t(c);case r.KANJI:return new n(c);case r.BYTE:return new e(c)}}i.fromArray=function(P){return P.reduce(function(S,f){return typeof f=="string"?S.push(R(f,null)):f.data&&S.push(R(f.data,f.mode)),S},[])},i.fromString=function(P,S){const f=N(P,a.isKanjiModeEnabled()),j=E(f),d=B(j,S),y=l.find_path(d.map,"start","end"),w=[];for(let m=1;m<y.length-1;m++)w.push(d.table[y[m]].node);return i.fromArray(g(w))},i.rawSplit=function(P){return i.fromArray(N(P,a.isKanjiModeEnabled()))}})(de)),de}var Qe;function At(){if(Qe)return Z;Qe=1;const i=k(),r=Ce(),s=ct(),t=ut(),e=dt(),n=ft(),o=ht(),a=tt(),l=mt(),h=vt(),p=wt(),N=F(),v=St();function g(d,y){const w=d.size,m=n.getPositions(y);for(let A=0;A<m.length;A++){const C=m[A][0],_=m[A][1];for(let b=-1;b<=7;b++)if(!(C+b<=-1||w<=C+b))for(let I=-1;I<=7;I++)_+I<=-1||w<=_+I||(b>=0&&b<=6&&(I===0||I===6)||I>=0&&I<=6&&(b===0||b===6)||b>=2&&b<=4&&I>=2&&I<=4?d.set(C+b,_+I,!0,!0):d.set(C+b,_+I,!1,!0))}}function E(d){const y=d.size;for(let w=8;w<y-8;w++){const m=w%2===0;d.set(w,6,m,!0),d.set(6,w,m,!0)}}function B(d,y){const w=e.getPositions(y);for(let m=0;m<w.length;m++){const A=w[m][0],C=w[m][1];for(let _=-2;_<=2;_++)for(let b=-2;b<=2;b++)_===-2||_===2||b===-2||b===2||_===0&&b===0?d.set(A+_,C+b,!0,!0):d.set(A+_,C+b,!1,!0)}}function R(d,y){const w=d.size,m=h.getEncodedBits(y);let A,C,_;for(let b=0;b<18;b++)A=Math.floor(b/3),C=b%3+w-8-3,_=(m>>b&1)===1,d.set(A,C,_,!0),d.set(C,A,_,!0)}function c(d,y,w){const m=d.size,A=p.getEncodedBits(y,w);let C,_;for(C=0;C<15;C++)_=(A>>C&1)===1,C<6?d.set(C,8,_,!0):C<8?d.set(C+1,8,_,!0):d.set(m-15+C,8,_,!0),C<8?d.set(8,m-C-1,_,!0):C<9?d.set(8,15-C-1+1,_,!0):d.set(8,15-C-1,_,!0);d.set(m-8,8,1,!0)}function P(d,y){const w=d.size;let m=-1,A=w-1,C=7,_=0;for(let b=w-1;b>0;b-=2)for(b===6&&b--;;){for(let I=0;I<2;I++)if(!d.isReserved(A,b-I)){let L=!1;_<y.length&&(L=(y[_]>>>C&1)===1),d.set(A,b-I,L),C--,C===-1&&(_++,C=7)}if(A+=m,A<0||w<=A){A-=m,m=-m;break}}}function S(d,y,w){const m=new s;w.forEach(function(I){m.put(I.mode.bit,4),m.put(I.getLength(),N.getCharCountIndicator(I.mode,d)),I.write(m)});const A=i.getSymbolTotalCodewords(d),C=a.getTotalCodewordsCount(d,y),_=(A-C)*8;for(m.getLengthInBits()+4<=_&&m.put(0,4);m.getLengthInBits()%8!==0;)m.putBit(0);const b=(_-m.getLengthInBits())/8;for(let I=0;I<b;I++)m.put(I%2?17:236,8);return f(m,d,y)}function f(d,y,w){const m=i.getSymbolTotalCodewords(y),A=a.getTotalCodewordsCount(y,w),C=m-A,_=a.getBlocksCount(y,w),b=m%_,I=_-b,L=Math.floor(m/_),V=Math.floor(C/_),st=V+1,be=L-V,ot=new l(be);let Q=0;const O=new Array(_),_e=new Array(_);let Y=0;const lt=new Uint8Array(d.buffer);for(let H=0;H<_;H++){const $=H<I?V:st;O[H]=lt.slice(Q,Q+$),_e[H]=ot.encode(O[H]),Q+=$,Y=Math.max(Y,$)}const G=new Uint8Array(m);let Ne=0,x,D;for(x=0;x<Y;x++)for(D=0;D<_;D++)x<O[D].length&&(G[Ne++]=O[D][x]);for(x=0;x<be;x++)for(D=0;D<_;D++)G[Ne++]=_e[D][x];return G}function j(d,y,w,m){let A;if(Array.isArray(d))A=v.fromArray(d);else if(typeof d=="string"){let L=y;if(!L){const V=v.rawSplit(d);L=h.getBestVersionForData(V,w)}A=v.fromString(d,L||40)}else throw new Error("Invalid data");const C=h.getBestVersionForData(A,w);if(!C)throw new Error("The amount of data is too big to be stored in a QR Code");if(!y)y=C;else if(y<C)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+C+`.
7
+ `);const _=S(y,w,A),b=i.getSymbolSize(y),I=new t(b);return g(I,y),E(I),B(I,y),c(I,w,0),y>=7&&R(I,y),P(I,_),isNaN(m)&&(m=o.getBestMask(I,c.bind(null,I,w))),o.applyMask(m,I),c(I,w,m),{modules:I,version:y,errorCorrectionLevel:w,maskPattern:m,segments:A}}return Z.create=function(y,w){if(typeof y>"u"||y==="")throw new Error("No input text");let m=r.M,A,C;return typeof w<"u"&&(m=r.from(w.errorCorrectionLevel,r.M),A=h.from(w.version),C=o.from(w.maskPattern),w.toSJISFunc&&i.setToSJISFunction(w.toSJISFunc)),j(y,A,m,C)},Z}var ve={},we={},Ye;function rt(){return Ye||(Ye=1,(function(i){function r(s){if(typeof s=="number"&&(s=s.toString()),typeof s!="string")throw new Error("Color should be defined as hex string");let t=s.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+s);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(n){return[n,n]}))),t.length===6&&t.push("F","F");const e=parseInt(t.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+t.slice(0,6).join("")}}i.getOptions=function(t){t||(t={}),t.color||(t.color={});const e=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:n,scale:n?4:o,margin:e,color:{dark:r(t.color.dark||"#000000ff"),light:r(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},i.getScale=function(t,e){return e.width&&e.width>=t+e.margin*2?e.width/(t+e.margin*2):e.scale},i.getImageWidth=function(t,e){const n=i.getScale(t,e);return Math.floor((t+e.margin*2)*n)},i.qrToImageData=function(t,e,n){const o=e.modules.size,a=e.modules.data,l=i.getScale(o,n),h=Math.floor((o+n.margin*2)*l),p=n.margin*l,N=[n.color.light,n.color.dark];for(let v=0;v<h;v++)for(let g=0;g<h;g++){let E=(v*h+g)*4,B=n.color.light;if(v>=p&&g>=p&&v<h-p&&g<h-p){const R=Math.floor((v-p)/l),c=Math.floor((g-p)/l);B=N[a[R*o+c]?1:0]}t[E++]=B.r,t[E++]=B.g,t[E++]=B.b,t[E]=B.a}}})(we)),we}var Ge;function Et(){return Ge||(Ge=1,(function(i){const r=rt();function s(e,n,o){e.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=o,n.width=o,n.style.height=o+"px",n.style.width=o+"px"}function t(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}i.render=function(n,o,a){let l=a,h=o;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(h=t()),l=r.getOptions(l);const p=r.getImageWidth(n.modules.size,l),N=h.getContext("2d"),v=N.createImageData(p,p);return r.qrToImageData(v.data,n,l),s(N,h,p),N.putImageData(v,0,0),h},i.renderToDataURL=function(n,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const h=i.render(n,o,l),p=l.type||"image/png",N=l.rendererOpts||{};return h.toDataURL(p,N.quality)}})(ve)),ve}var ye={},$e;function Bt(){if($e)return ye;$e=1;const i=rt();function r(e,n){const o=e.a/255,a=n+'="'+e.hex+'"';return o<1?a+" "+n+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function s(e,n,o){let a=e+n;return typeof o<"u"&&(a+=" "+o),a}function t(e,n,o){let a="",l=0,h=!1,p=0;for(let N=0;N<e.length;N++){const v=Math.floor(N%n),g=Math.floor(N/n);!v&&!h&&(h=!0),e[N]?(p++,N>0&&v>0&&e[N-1]||(a+=h?s("M",v+o,.5+g+o):s("m",l,0),l=0,h=!1),v+1<n&&e[N+1]||(a+=s("h",p),p=0)):l++}return a}return ye.render=function(n,o,a){const l=i.getOptions(o),h=n.modules.size,p=n.modules.data,N=h+l.margin*2,v=l.color.light.a?"<path "+r(l.color.light,"fill")+' d="M0 0h'+N+"v"+N+'H0z"/>':"",g="<path "+r(l.color.dark,"stroke")+' d="'+t(p,h,l.margin)+'"/>',E='viewBox="0 0 '+N+" "+N+'"',R='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+E+' shape-rendering="crispEdges">'+v+g+`</svg>
8
+ `;return typeof a=="function"&&a(null,R),R},ye}var We;function It(){if(We)return z;We=1;const i=at(),r=At(),s=Et(),t=Bt();function e(n,o,a,l,h){const p=[].slice.call(arguments,1),N=p.length,v=typeof p[N-1]=="function";if(!v&&!i())throw new Error("Callback required as last argument");if(v){if(N<2)throw new Error("Too few arguments provided");N===2?(h=a,a=o,o=l=void 0):N===3&&(o.getContext&&typeof h>"u"?(h=l,l=void 0):(h=l,l=a,a=o,o=void 0))}else{if(N<1)throw new Error("Too few arguments provided");return N===1?(a=o,o=l=void 0):N===2&&!o.getContext&&(l=a,a=o,o=void 0),new Promise(function(g,E){try{const B=r.create(a,l);g(n(B,o,l))}catch(B){E(B)}})}try{const g=r.create(a,l);h(null,n(g,o,l))}catch(g){h(g)}}return z.create=r.create,z.toCanvas=e.bind(null,s.render),z.toDataURL=e.bind(null,s.renderToDataURL),z.toString=e.bind(null,function(n,o,a){return t.render(n,a)}),z}var Pt=It();const jt=Xe.getDefaultExportFromCjs(Pt),Rt=[{id:"signing",title:"Prepare signing",description:"Choose Apple ID login or upload certificates for a registered developer device."},{id:"build",title:"Build for device",description:"Start the signed iPhone build for the selected signing mode."},{id:"connect",title:"Connect and pair",description:"After the build succeeds, connect the iPhone with WebUSB and pair this browser."},{id:"install",title:"Start installation",description:"Install the last successful device build."}];function Tt({disabled:i,...r}){const[s,t]=T.useState(!1),[e,n]=T.useState("signing"),[o,a]=T.useState(),[l,h]=T.useState(""),[p,N]=T.useState(""),[v,g]=T.useState(""),[E,B]=T.useState(),R=T.useId(),c=Xe.useDeviceInstall(r),P=Rt.filter(f=>c.signingMode==="development"||f.id!=="connect");T.useEffect(()=>{n(c.currentStep)},[c.currentStep]),T.useEffect(()=>{let f=!1;if(!c.otaInstall?.landingUrl){B(void 0);return}return jt.toDataURL(c.otaInstall.landingUrl,{margin:1,width:240}).then(j=>{f||B(j)}),()=>{f=!0}},[c.otaInstall?.landingUrl]);const S=(f,j)=>{c.setSigningFiles({[f]:j.currentTarget.files?.[0]})};return u.jsxs("div",{className:"lr-device-install",children:[u.jsx("button",{type:"button",className:"lr-device-install__trigger",disabled:i||!r.apiUrl,onClick:()=>t(!0),children:"Install to iPhone"}),s&&u.jsx("div",{className:"lr-device-install__backdrop",role:"presentation",children:u.jsxs("section",{"aria-labelledby":R,"aria-modal":"true",className:"lr-device-install__dialog",role:"dialog",children:[u.jsxs("header",{className:"lr-device-install__header",children:[u.jsxs("div",{children:[u.jsx("h2",{id:R,children:"Install to a real iPhone"}),u.jsx("p",{children:"Prepare signing, build for the registered device, then install with QR or WebUSB based on signing mode."})]}),u.jsx("button",{type:"button",className:"lr-device-install__icon-button",onClick:()=>t(!1),children:"Close"})]}),c.error&&u.jsx("div",{className:"lr-device-install__error",children:c.error}),u.jsx("div",{className:"lr-device-install__steps",children:P.map((f,j)=>u.jsxs(Mt,{index:j+1,step:f,active:c.currentStep===f.id,open:e===f.id,status:c.stepStatuses[f.id],onToggle:()=>n(f.id),children:[f.id==="signing"&&u.jsxs("div",{className:"lr-device-install__step-body",children:[u.jsxs("div",{className:"lr-device-install__choice-grid",children:[u.jsxs("button",{type:"button",className:q("lr-device-install__choice",c.signingMode==="development"&&"lr-device-install__choice--active"),onClick:()=>c.setSigningMode("development"),children:[u.jsx("strong",{children:"Development + WebUSB"}),u.jsx("span",{children:"Use Apple Development signing and install by pairing the iPhone with this browser."})]}),u.jsxs("button",{type:"button",className:q("lr-device-install__choice",c.signingMode==="adhoc"&&"lr-device-install__choice--active"),onClick:()=>c.setSigningMode("adhoc"),children:[u.jsx("strong",{children:"Ad Hoc + QR"}),u.jsx("span",{children:"Use registered-device Ad Hoc signing and install from iPhone Camera or Safari."})]})]}),u.jsxs("div",{className:"lr-device-install__choice-grid",children:[u.jsxs("button",{type:"button",className:q("lr-device-install__choice",o==="apple-id"&&"lr-device-install__choice--active"),onClick:()=>a("apple-id"),children:[u.jsx("strong",{children:"Apple ID login"}),u.jsx("span",{children:"Sign in, choose team, bundle ID, and registered devices, then generate signing assets."})]}),u.jsxs("button",{type:"button",className:q("lr-device-install__choice",o==="upload"&&"lr-device-install__choice--active"),onClick:()=>a("upload"),children:[u.jsx("strong",{children:"Upload certificates"}),u.jsx("span",{children:"Use an existing .p12 certificate and provisioning profile."})]})]}),o==="apple-id"&&u.jsxs("div",{className:"lr-device-install__section-panel",children:[u.jsxs("div",{className:"lr-device-install__grid",children:[u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Apple ID"}),u.jsx("input",{type:"email",autoComplete:"username",placeholder:"name@example.com",value:l,onChange:d=>h(d.currentTarget.value)})]}),u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Apple ID password"}),u.jsx("input",{type:"password",autoComplete:"current-password",placeholder:"Password stays in this browser",value:p,onChange:d=>N(d.currentTarget.value)})]})]}),u.jsxs("div",{className:"lr-device-install__actions",children:[u.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:i||!r.apiUrl||!l||!p||c.busyAction==="signing",onClick:()=>void c.startAppleIDLogin({accountName:l,password:p}),children:c.appleSigningStatus==="authenticating"?"Signing in...":"Sign in with Apple ID"}),u.jsxs("span",{className:"lr-device-install__hint",children:["Apple password is used only by browser-side SRP. Status: ",c.appleSigningStatus]})]}),c.appleSigningStatus==="two-factor-required"&&u.jsxs("div",{className:"lr-device-install__grid",children:[u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Two-factor code"}),u.jsx("input",{type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:v,onChange:d=>g(d.currentTarget.value)})]}),u.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:!v||c.busyAction==="signing",onClick:()=>void c.submitAppleTwoFactorCode(v),children:"Submit Apple ID code"})]}),c.appleTeams.length>0&&u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Apple Developer team"}),u.jsx("select",{value:c.selectedAppleTeamID??"",onChange:d=>c.setSelectedAppleTeamID(d.currentTarget.value||void 0),children:c.appleTeams.map((d,y)=>{const w=d.teamId??(d.providerId===void 0?void 0:String(d.providerId))??d.publicProviderId??"";return u.jsxs("option",{value:w,children:[d.name??"Apple Developer Team"," ",w?`(${w})`:""]},`${w}-${y}`)})})]}),c.appleDevices.length>0&&u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Apple Developer devices"}),u.jsx("select",{multiple:!0,value:c.selectedAppleDeviceIDs,onChange:d=>c.setSelectedAppleDeviceIDs(Array.from(d.currentTarget.selectedOptions).map(y=>y.value)),children:c.appleDevices.map(d=>u.jsxs("option",{value:d.deviceId??"",children:[d.name??d.model??"Apple device"," ",d.deviceNumber??""]},d.deviceId??d.deviceNumber))})]}),c.applePortalSummary&&u.jsxs("p",{className:"lr-device-install__hint",children:["Found ",c.applePortalSummary.certificateCount," certificates and"," ",c.applePortalSummary.profileCount," provisioning profiles."]}),c.hasReusableAppleCertificate&&u.jsx("p",{className:"lr-device-install__hint",children:"Reusing the certificate and private key stored in this browser."}),u.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:i||!c.canPrepareAppleSigningAssets,onClick:()=>void c.prepareAppleSigningAssets(),children:c.appleSigningStatus==="preparing-assets"?"Preparing signing assets...":c.signingMode==="adhoc"?"Generate Ad Hoc signing assets":"Generate development signing assets"})]}),o==="upload"&&u.jsxs("div",{className:"lr-device-install__section-panel",children:[u.jsxs("div",{className:"lr-device-install__grid",children:[u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Certificate (.p12)"}),u.jsx("input",{type:"file",accept:".p12,application/x-pkcs12",onChange:d=>S("certificateFile",d)})]}),u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Provisioning profile"}),u.jsx("input",{type:"file",accept:".mobileprovision",onChange:d=>S("provisioningProfileFile",d)})]}),u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Uploaded .p12 password (optional)"}),u.jsx("input",{type:"password",placeholder:"Leave empty if the certificate has no password",onChange:d=>c.setSigningFiles({certificatePassword:d.currentTarget.value})})]})]}),u.jsx("p",{className:"lr-device-install__hint",children:"The provisioning profile will be checked against the connected iPhone before installation."})]}),c.hasSigningAssets&&u.jsx("p",{children:"Signing assets are stored in this browser for the selected bundle and device."})]}),f.id==="connect"&&u.jsxs("div",{className:"lr-device-install__step-body",children:[u.jsx("p",{children:"WebUSB works in Chromium browsers on secure origins. Once the build succeeds, connect the iPhone over USB, approve the browser permission prompt, then pair this browser."}),u.jsxs("div",{className:"lr-device-install__actions",children:[u.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:i||!c.canRequestUSBAccess,onClick:()=>void c.requestUSBAccess(),children:c.busyAction==="usb"?"Selecting iPhone...":"Allow USB access"}),u.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:i||!c.canPairBrowser,onClick:()=>void c.pairBrowser(),children:c.busyAction==="pair"?"Pairing...":c.pairConfirmationRequired?"Confirm pair record":"Pair browser"})]}),c.device&&u.jsx("div",{className:"lr-device-install__device",children:`${c.device.productName??"iPhone"} ${c.device.serialNumber??""}`.trim()}),c.pairConfirmationRequired&&u.jsxs("p",{children:["Unlock the iPhone and tap ",u.jsx("strong",{children:"Trust"})," in the system dialog, then confirm the pair record."]}),u.jsx("p",{children:c.hasPairRecord?"Pair record is stored locally. Continue to installation.":"Pair this browser once before installing."})]}),f.id==="build"&&u.jsxs("div",{className:"lr-device-install__step-body",children:[u.jsxs("div",{className:"lr-device-install__checklist",children:[u.jsx(Ze,{label:"Signing assets",ready:c.hasSigningInputs}),u.jsx(Ze,{label:"Device build",ready:c.buildStatus==="succeeded"?!0:void 0,pendingText:"Not started"})]}),u.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:i||!c.canBuild,onClick:()=>void c.startDeviceBuild(),children:c.busyAction==="build"?"Starting build...":"Start device build"}),u.jsxs("details",{className:"lr-device-install__build-logs",open:c.buildLogPanelOpen,onToggle:d=>c.setBuildLogPanelOpen(d.currentTarget.open),children:[u.jsxs("summary",{children:["Build logs (",c.buildStatus,")"]}),u.jsx("pre",{children:c.buildLogs.length>0?c.buildLogs.filter(d=>d.type!=="meta").map(d=>d.data).join(`
9
+ `):"Build logs will appear here while the device build is running."})]})]}),f.id==="install"&&u.jsx("div",{className:"lr-device-install__step-body",children:c.signingMode==="adhoc"?u.jsxs("div",{className:"lr-device-install__section-panel lr-device-install__ota-panel",children:[u.jsxs("div",{children:[u.jsx("h4",{children:"Install with iPhone Camera"}),u.jsx("p",{className:"lr-device-install__hint",children:"Scan this QR code on a registered iPhone to open an HTTPS install page in Safari."})]}),E?u.jsx("img",{className:"lr-device-install__qr",src:E,alt:"Ad Hoc install QR code"}):u.jsx("div",{className:"lr-device-install__qr-placeholder",children:"Build an Ad Hoc IPA to generate a QR code."}),c.otaInstall&&u.jsxs("label",{className:"lr-device-install__field",children:[u.jsx("span",{children:"Install page link"}),u.jsx("input",{readOnly:!0,value:c.otaInstall.landingUrl})]}),u.jsx("p",{className:"lr-device-install__hint",children:"Requires HTTPS and an Ad Hoc profile containing this device UDID."})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:i||!c.canInstall,onClick:()=>void c.startInstallation(),children:c.busyAction==="install"?"Installing...":"Install last build"}),u.jsx("button",{type:"button",className:"lr-device-install__secondary",onClick:c.stopRelay,children:"Stop relay"})]})})]},f.id))}),u.jsxs("footer",{className:"lr-device-install__logs",children:[u.jsx("h3",{children:"Progress"}),u.jsx("ol",{children:c.logs.map((f,j)=>u.jsx("li",{children:f},`${j}-${f.slice(0,24)}`))})]})]})})]})}function Mt({index:i,step:r,active:s,open:t,status:e,onToggle:n,children:o}){return u.jsxs("article",{className:q("lr-device-install__step",s&&"lr-device-install__step--active"),children:[u.jsxs("button",{type:"button",className:"lr-device-install__step-header","aria-expanded":t,onClick:n,children:[u.jsx("div",{className:"lr-device-install__step-number",children:i}),u.jsxs("div",{children:[u.jsx("h3",{children:r.title}),u.jsx("p",{children:r.description})]}),u.jsx("span",{className:q("lr-device-install__status",`lr-device-install__status--${e}`),children:e==="complete"?"✓ Completed":e})]}),t&&o]})}function Ze({label:i,ready:r,pendingText:s="Not ready"}){const t=r===void 0?s:r?"Ready":"Needs attention";return u.jsxs("div",{className:"lr-device-install__check-row",children:[u.jsx("span",{children:i}),u.jsx("strong",{children:t})]})}exports.DeviceInstallDialog=Tt;exports.clsx=q;