@kaeawc/auto-mobile 0.0.93 → 0.0.94

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 (228) hide show
  1. package/dist/build-info.json +12 -12
  2. package/dist/src/ble-peripheral.py +153 -0
  3. package/dist/src/{chunk-r6z1eztj.js → chunk-026y62r9.js} +11 -11
  4. package/dist/src/chunk-0jyfg947.js +4 -0
  5. package/dist/src/{chunk-8g1922rp.js → chunk-0zfpp1wh.js} +4 -4
  6. package/dist/src/{chunk-qf6nynk6.js → chunk-13qxf7ym.js} +5 -5
  7. package/dist/src/chunk-1scenrk7.js +4 -0
  8. package/dist/src/chunk-1vb5ph1k.js +4 -0
  9. package/dist/src/{chunk-710rxz9y.js → chunk-20g565q7.js} +3 -3
  10. package/dist/src/chunk-21h6dhdm.js +5 -0
  11. package/dist/src/chunk-25mfpthk.js +78 -0
  12. package/dist/src/{chunk-rbpdk7m0.js → chunk-2b39zyxc.js} +3 -3
  13. package/dist/src/chunk-2gzd6wbd.js +4 -0
  14. package/dist/src/{chunk-xgan0qqp.js → chunk-3dntffy9.js} +1 -1
  15. package/dist/src/chunk-3gfczcsn.js +4 -0
  16. package/dist/src/{chunk-dgrbdpb7.js → chunk-3h5jz1vb.js} +6 -6
  17. package/dist/src/{chunk-t6c8akcm.js → chunk-41zcy6b3.js} +3 -3
  18. package/dist/src/chunk-47n9m2de.js +4 -0
  19. package/dist/src/chunk-4vxeq0vd.js +58 -0
  20. package/dist/src/chunk-59dx6qaf.js +4 -0
  21. package/dist/src/chunk-5sdf9y92.js +4 -0
  22. package/dist/src/{chunk-58wzr3mt.js → chunk-5wk1t46v.js} +3 -3
  23. package/dist/src/{chunk-vy3bwm1d.js → chunk-661c50hh.js} +5 -5
  24. package/dist/src/chunk-68n6bjjd.js +21 -0
  25. package/dist/src/{chunk-v6pya0dm.js → chunk-69pmjdf2.js} +3 -3
  26. package/dist/src/{chunk-e98dqnc9.js → chunk-6hrj3jt6.js} +20 -20
  27. package/dist/src/{chunk-wbh8spm5.js → chunk-6myr26wx.js} +8 -8
  28. package/dist/src/chunk-6n96k09n.js +4 -0
  29. package/dist/src/chunk-6vwrbkre.js +4 -0
  30. package/dist/src/chunk-6wk0yrab.js +4 -0
  31. package/dist/src/chunk-6yhm9een.js +4 -0
  32. package/dist/src/{chunk-mjrps0ac.js → chunk-7k7gjg2t.js} +5 -5
  33. package/dist/src/chunk-7n5fz68h.js +4 -0
  34. package/dist/src/chunk-8cvnpnbp.js +4 -0
  35. package/dist/src/chunk-8kzv7rk7.js +4 -0
  36. package/dist/src/chunk-8nj68t1v.js +167 -0
  37. package/dist/src/{chunk-g7tmjbkt.js → chunk-96r3bpg7.js} +3 -3
  38. package/dist/src/chunk-97x887te.js +4 -0
  39. package/dist/src/{chunk-8ph29g99.js → chunk-99a6tbvd.js} +1 -1
  40. package/dist/src/chunk-9p5d2994.js +5 -0
  41. package/dist/src/{chunk-aabchzxk.js → chunk-9q265er0.js} +4 -4
  42. package/dist/src/{chunk-jh6vhqzx.js → chunk-9xgnrv5w.js} +3 -3
  43. package/dist/src/chunk-9xgsmshb.js +5 -0
  44. package/dist/src/chunk-a02d1wgv.js +4 -0
  45. package/dist/src/{chunk-ndt1ccxm.js → chunk-a9ps00a1.js} +10 -10
  46. package/dist/src/{chunk-5d2hft6c.js → chunk-aewdveet.js} +3 -3
  47. package/dist/src/{chunk-ycaj2sgf.js → chunk-b3tdtq7r.js} +6 -6
  48. package/dist/src/chunk-bn7jx7a2.js +4 -0
  49. package/dist/src/{chunk-3y6eykz9.js → chunk-bnyw27ja.js} +2 -2
  50. package/dist/src/{chunk-rqc9ap3x.js → chunk-bpwsg76p.js} +2 -2
  51. package/dist/src/chunk-bvranw3g.js +4 -0
  52. package/dist/src/chunk-c25a84zb.js +4 -0
  53. package/dist/src/chunk-c27yv1dx.js +5 -0
  54. package/dist/src/chunk-c3ewxm4x.js +5 -0
  55. package/dist/src/{chunk-rvvy1bte.js → chunk-cb1ga9rd.js} +5 -5
  56. package/dist/src/chunk-cn7fwy7k.js +4 -0
  57. package/dist/src/chunk-cnvy4a64.js +4 -0
  58. package/dist/src/{chunk-7rz9898k.js → chunk-cqhw4yr6.js} +3 -3
  59. package/dist/src/{chunk-g04bwyj3.js → chunk-ctmfshjc.js} +2 -2
  60. package/dist/src/chunk-ctwmhz13.js +4 -0
  61. package/dist/src/{chunk-waqwcjyn.js → chunk-d3jx9bz5.js} +2 -2
  62. package/dist/src/{chunk-ayp07wbb.js → chunk-d6rb08ga.js} +1 -1
  63. package/dist/src/chunk-ddqhj4eg.js +5 -0
  64. package/dist/src/{chunk-r7bpkgff.js → chunk-ddrhs1c3.js} +2 -2
  65. package/dist/src/chunk-dnjnh9p6.js +4 -0
  66. package/dist/src/{chunk-wyrkw6hw.js → chunk-dw5rwgya.js} +3 -3
  67. package/dist/src/{chunk-3xkpk44w.js → chunk-e0870khr.js} +3 -3
  68. package/dist/src/chunk-ea3k10kj.js +4 -0
  69. package/dist/src/chunk-emv82m1w.js +7 -0
  70. package/dist/src/chunk-f3m6pdnx.js +4 -0
  71. package/dist/src/chunk-f84z32cb.js +4 -0
  72. package/dist/src/chunk-fpczgf0z.js +4 -0
  73. package/dist/src/{chunk-2tqzq5qh.js → chunk-g2js4c2v.js} +18 -18
  74. package/dist/src/chunk-g3af2qbk.js +5 -0
  75. package/dist/src/{chunk-3qwrzxh0.js → chunk-gadtna7s.js} +6 -6
  76. package/dist/src/{chunk-ybbtagbt.js → chunk-gcyx407v.js} +3 -3
  77. package/dist/src/{chunk-bfw6125s.js → chunk-gfpntwc1.js} +3 -3
  78. package/dist/src/chunk-gmnm5e3e.js +4 -0
  79. package/dist/src/chunk-gp6vb5gf.js +4 -0
  80. package/dist/src/chunk-gppgy7pa.js +4 -0
  81. package/dist/src/chunk-hegfz0ae.js +5 -0
  82. package/dist/src/chunk-hpzxdp1k.js +17 -0
  83. package/dist/src/{chunk-qcxzr2my.js → chunk-j69g8b50.js} +3 -3
  84. package/dist/src/chunk-jvstjnqm.js +19 -0
  85. package/dist/src/chunk-jzqrv78s.js +4 -0
  86. package/dist/src/chunk-k2948b8d.js +4 -0
  87. package/dist/src/chunk-k4ftd40d.js +4 -0
  88. package/dist/src/{chunk-bxmsax22.js → chunk-kd9vfaxh.js} +3 -3
  89. package/dist/src/{chunk-s3jc6cwp.js → chunk-kdczmgwk.js} +3 -3
  90. package/dist/src/{chunk-t6bfvfkg.js → chunk-ke3wn14v.js} +1 -1
  91. package/dist/src/chunk-kh5n7m6w.js +4 -0
  92. package/dist/src/{chunk-6wt9rgjf.js → chunk-khejfph4.js} +3 -3
  93. package/dist/src/chunk-kny2xemh.js +4 -0
  94. package/dist/src/chunk-knyzw9md.js +4 -0
  95. package/dist/src/chunk-mbzpt2hp.js +4 -0
  96. package/dist/src/chunk-mm8rcxad.js +4 -0
  97. package/dist/src/chunk-nc4516tx.js +4 -0
  98. package/dist/src/{chunk-6bznss4t.js → chunk-ntfrqrqn.js} +5 -5
  99. package/dist/src/chunk-nz5h2j52.js +4 -0
  100. package/dist/src/chunk-p22s97qy.js +4 -0
  101. package/dist/src/chunk-p9kt1sgr.js +6 -0
  102. package/dist/src/{chunk-yb97j25b.js → chunk-pf282r5g.js} +4 -4
  103. package/dist/src/chunk-pnd4mrxy.js +4 -0
  104. package/dist/src/chunk-pqqteyj6.js +4 -0
  105. package/dist/src/{chunk-6xmss8er.js → chunk-qj1tbnv2.js} +6 -6
  106. package/dist/src/chunk-qnh9egwr.js +4 -0
  107. package/dist/src/chunk-qy3khhf8.js +8 -0
  108. package/dist/src/{chunk-z637nqg8.js → chunk-r0vp315h.js} +6 -6
  109. package/dist/src/chunk-r4j43b9s.js +237 -0
  110. package/dist/src/{chunk-1p7xf5kb.js → chunk-r54cxxze.js} +3 -3
  111. package/dist/src/{chunk-yf7ympyz.js → chunk-r6pvhj33.js} +92 -92
  112. package/dist/src/chunk-rb7aa5gr.js +54 -0
  113. package/dist/src/chunk-rdj50kb4.js +4 -0
  114. package/dist/src/chunk-rnd4vcas.js +4 -0
  115. package/dist/src/{chunk-w5b2jwk3.js → chunk-s3y3zfcx.js} +8 -8
  116. package/dist/src/chunk-s4g43k75.js +5 -0
  117. package/dist/src/chunk-sfqe223f.js +311 -0
  118. package/dist/src/{chunk-284ptqa4.js → chunk-sqdrxjw5.js} +5 -5
  119. package/dist/src/{chunk-zgja5f3p.js → chunk-t54k47em.js} +4 -4
  120. package/dist/src/{chunk-3sy6ahhz.js → chunk-tek4pnvv.js} +10 -10
  121. package/dist/src/chunk-tn74y7af.js +4 -0
  122. package/dist/src/{chunk-thbh3jew.js → chunk-tvq0nzam.js} +3 -3
  123. package/dist/src/{chunk-0jrrsnc9.js → chunk-tx4f0h9c.js} +4 -4
  124. package/dist/src/chunk-vdqag3fj.js +5 -0
  125. package/dist/src/chunk-vz5zzs57.js +4 -0
  126. package/dist/src/chunk-w4s2vfpj.js +4 -0
  127. package/dist/src/{chunk-4hw3665t.js → chunk-w5yypt53.js} +11 -11
  128. package/dist/src/{chunk-8037tzzj.js → chunk-w68v64vh.js} +3 -3
  129. package/dist/src/chunk-whwj0pdk.js +5 -0
  130. package/dist/src/chunk-wnmqt1dc.js +4 -0
  131. package/dist/src/{chunk-cyy71ggq.js → chunk-wpe46vsa.js} +3 -3
  132. package/dist/src/{chunk-w3vs79ex.js → chunk-wxdjeb4k.js} +19 -19
  133. package/dist/src/chunk-xcqzwf9j.js +247 -0
  134. package/dist/src/chunk-xezekwwn.js +5 -0
  135. package/dist/src/chunk-xf19m15s.js +4 -0
  136. package/dist/src/chunk-xghbxha4.js +4 -0
  137. package/dist/src/{chunk-00167wan.js → chunk-xn9m3xc2.js} +5 -5
  138. package/dist/src/{chunk-26k317v5.js → chunk-yqfz4vts.js} +3 -3
  139. package/dist/src/chunk-z8tvs8nk.js +5 -0
  140. package/dist/src/chunk-zm2rehqb.js +5 -0
  141. package/dist/src/chunk-zs6dqm35.js +4 -0
  142. package/dist/src/daemon/processEntry.js +2 -2
  143. package/dist/src/index.js +4 -4
  144. package/dist/src/runtime/bunRuntimeGuard.js +2 -2
  145. package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -2
  146. package/package.json +2 -2
  147. package/dist/src/chunk-0n6swkwg.js +0 -5
  148. package/dist/src/chunk-0qsy1qsx.js +0 -57
  149. package/dist/src/chunk-11m8wj8j.js +0 -237
  150. package/dist/src/chunk-23p5f095.js +0 -4
  151. package/dist/src/chunk-28re4xrg.js +0 -4
  152. package/dist/src/chunk-2f9rkmhx.js +0 -5
  153. package/dist/src/chunk-2fxdh48t.js +0 -4
  154. package/dist/src/chunk-2tbdrbt6.js +0 -4
  155. package/dist/src/chunk-32gvv9b4.js +0 -21
  156. package/dist/src/chunk-3f3t1x97.js +0 -8
  157. package/dist/src/chunk-3fspkbc7.js +0 -4
  158. package/dist/src/chunk-3vg455e6.js +0 -4
  159. package/dist/src/chunk-49bsqdx3.js +0 -4
  160. package/dist/src/chunk-5snsn9cf.js +0 -4
  161. package/dist/src/chunk-5tm9mn47.js +0 -54
  162. package/dist/src/chunk-5zc77a5t.js +0 -4
  163. package/dist/src/chunk-64j0majr.js +0 -19
  164. package/dist/src/chunk-65y8v4td.js +0 -17
  165. package/dist/src/chunk-6awz7vhq.js +0 -5
  166. package/dist/src/chunk-6ep7f5ge.js +0 -4
  167. package/dist/src/chunk-7cs2da62.js +0 -5
  168. package/dist/src/chunk-7g103b54.js +0 -4
  169. package/dist/src/chunk-7j5vj4pa.js +0 -4
  170. package/dist/src/chunk-7tw8x05v.js +0 -4
  171. package/dist/src/chunk-7zy586cb.js +0 -4
  172. package/dist/src/chunk-84nanf8s.js +0 -5
  173. package/dist/src/chunk-8gvwcv2p.js +0 -4
  174. package/dist/src/chunk-8thrmfat.js +0 -4
  175. package/dist/src/chunk-8zgzzs7k.js +0 -78
  176. package/dist/src/chunk-97b1zmaq.js +0 -4
  177. package/dist/src/chunk-9fth9ayh.js +0 -4
  178. package/dist/src/chunk-9j6anhjr.js +0 -4
  179. package/dist/src/chunk-bfjwqk8q.js +0 -4
  180. package/dist/src/chunk-bnhscm2n.js +0 -4
  181. package/dist/src/chunk-c1vs4g1n.js +0 -4
  182. package/dist/src/chunk-ct3e7yng.js +0 -4
  183. package/dist/src/chunk-ddzkz92z.js +0 -4
  184. package/dist/src/chunk-drdz8hee.js +0 -5
  185. package/dist/src/chunk-eersndy7.js +0 -5
  186. package/dist/src/chunk-eggq53ks.js +0 -4
  187. package/dist/src/chunk-f2dya7cs.js +0 -4
  188. package/dist/src/chunk-fbakd6cw.js +0 -4
  189. package/dist/src/chunk-fgb98zjj.js +0 -5
  190. package/dist/src/chunk-fmpad823.js +0 -5
  191. package/dist/src/chunk-g0xr8zw0.js +0 -4
  192. package/dist/src/chunk-g3rjs80x.js +0 -4
  193. package/dist/src/chunk-g78rtrfv.js +0 -4
  194. package/dist/src/chunk-gabgv3y5.js +0 -4
  195. package/dist/src/chunk-gmr45m8f.js +0 -4
  196. package/dist/src/chunk-gsyfebqj.js +0 -4
  197. package/dist/src/chunk-h5rpn9wr.js +0 -247
  198. package/dist/src/chunk-hb1x7v55.js +0 -4
  199. package/dist/src/chunk-hrfytkxh.js +0 -168
  200. package/dist/src/chunk-j4yjzbak.js +0 -4
  201. package/dist/src/chunk-jd6a5v6p.js +0 -5
  202. package/dist/src/chunk-kn5spq15.js +0 -4
  203. package/dist/src/chunk-m94qs0f0.js +0 -4
  204. package/dist/src/chunk-n03dmn5q.js +0 -5
  205. package/dist/src/chunk-n72qhwd9.js +0 -4
  206. package/dist/src/chunk-nr6y0n4y.js +0 -5
  207. package/dist/src/chunk-pcsen2vs.js +0 -4
  208. package/dist/src/chunk-ppfr0b8h.js +0 -4
  209. package/dist/src/chunk-q10bdnat.js +0 -4
  210. package/dist/src/chunk-q9xmq595.js +0 -4
  211. package/dist/src/chunk-qyqypn28.js +0 -5
  212. package/dist/src/chunk-r2epb56s.js +0 -4
  213. package/dist/src/chunk-r5bxavdx.js +0 -311
  214. package/dist/src/chunk-r8jf3d92.js +0 -4
  215. package/dist/src/chunk-rc0dbypm.js +0 -4
  216. package/dist/src/chunk-rhcty4ms.js +0 -4
  217. package/dist/src/chunk-rpvckv3p.js +0 -4
  218. package/dist/src/chunk-ry0mz41y.js +0 -4
  219. package/dist/src/chunk-sfv61xjb.js +0 -6
  220. package/dist/src/chunk-t7w8rctc.js +0 -4
  221. package/dist/src/chunk-v2wd4n3e.js +0 -5
  222. package/dist/src/chunk-w4zga19f.js +0 -4
  223. package/dist/src/chunk-w7hkv422.js +0 -5
  224. package/dist/src/chunk-xa73x2cx.js +0 -5
  225. package/dist/src/chunk-y2vs6jwg.js +0 -4
  226. package/dist/src/chunk-yattm52s.js +0 -4
  227. package/dist/src/chunk-yjawdzk8.js +0 -4
  228. package/dist/src/chunk-zs1sghs9.js +0 -4
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{nO,Wp,Fj,Yk,Jk,pi}from"./chunk-sfqe223f.js";import"./chunk-r6pvhj33.js";import"./chunk-r0vp315h.js";import"./chunk-5wk1t46v.js";export{pi as AndroidEmulatorClient,Yk as AndroidEmulatorUnavailableError,Jk as AndroidOfflineProbeError,Wp as boundedEmulatorOutputTail,Fj as emulatorLaunchOutputSource,nO as resetAndroidInventoryEnrichmentCache};
3
+
4
+ //# debugId=FCB238CB4B94989064756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{je,me,J,o,P,dt,_g,Tt,K,WB,Vt,KB,Ut,gd,es,x,E}from"./chunk-r5bxavdx.js";import{i,Wt,we,qt,l,e}from"./chunk-z637nqg8.js";import{Oe,Kt,At}from"./chunk-3xkpk44w.js";import{r,u,St}from"./chunk-rbpdk7m0.js";function LF(n,t,s){return["android.","androidx."].some((a)=>n?.startsWith(a))&&typeof t==="string"&&t!==""&&s===t}function F(n){return n?.tokens??[]}function S(n){return n.tokens===void 0?n.value??"":n.trailingText}function I(...n){return n.some((t)=>F(t).length>0)}function v(n){let t=F(n);return t.length===0?"no tokens":`tokens ${JSON.stringify(t)}`}function V(n,t){let s=Array.from(t),a=0;for(let d of n)if(d===s[a])a++;return a===s.length}function _(n,t,s){if(!I(t,s))return;if(F(s).length>F(t).length)return{success:!0};let a=S(t),d=S(s);if(a===void 0||d===void 0)return{success:!0,warning:"iOS typed text result was not verified: the recipient field's value does not follow its tokens."};if(a===d)return{success:!1,error:`iOS nothing was typed: no new recipient token was committed and the text after the tokens is unchanged (${v(s)}).`};return V(d,n)?{success:!0}:{success:!0,warning:`iOS typed text changed in the recipient field; text after the tokens: ${JSON.stringify(d)} (${v(s)}).`}}function D(n,t,s){if(!I(t,s))return;let a=F(t);if(F(s).length>a.length)return`a new recipient token was committed (${v(s)}).`;let c=t===void 0?"":S(t),f=S(s);if(c===void 0||f===void 0)return`the recipient field's value does not follow its tokens, so the typed text is unknown (${v(s)}).`;if(c===f)return`no new recipient token was committed and the text after the tokens is unchanged (${v(s)}).`;return V(f,n)?`the text after the recipient tokens now contains the typed characters (${v(s)}).`:`the text after the recipient tokens changed to ${JSON.stringify(f)} (partial or altered input; ${v(s)}).`}class N extends K{extractNodeProperties(n){let t=we(n),s=t.class??t.className;if(t.password===!0||t.password==="true"||typeof s==="string"&&s.includes("SecureTextField"))return{focused:t.focused,class:s,password:!0,editable:t.editable,actions:t.actions,"resource-id":t["resource-id"],bounds:t.bounds};return super.extractNodeProperties(n)}}var k=512,M=`iOS typed text result was not verified: the focused field value fills the ${k}-character read window, so a change past it cannot be seen.`;function B(n,t,s,a){let d=t.length+n.length-s.length;if(d<0||!a&&d!==0)return!1;for(let c=s.indexOf(n);c!==-1;c=s.indexOf(n,c+1)){if(s.slice(0,c)!==t.slice(0,c))return!1;if(s.slice(c+n.length)===t.slice(c+d))return!0}return!1}function Z(n,t,s,a){if(s.length===k)return{success:!0,warning:M};if(t===s)return{success:!1,error:"iOS nothing was typed: the focused field value is unchanged."};return B(n,t,s,a)?{success:!0}:{success:!1,error:"iOS typed text chunk was not fully appended to the focused field."}}function C(n,t={secure:!1},s={secure:!1},a=!1){if(t.secure||s.secure)return{success:!0,warning:"iOS typed text check skipped for a secure field."};let d=typeof a==="boolean"?a:a.verifyAppend,c=Q(t);return(d?ee(n,c,s,typeof a!=="boolean"&&a.firstChunk===!0):void 0)??te(n,c,s)}function Q(n){return n.iosNativeValueOmitted===!0&&n.value===void 0?{...n,value:""}:n}function ee(n,t,s,a){if(t.identity!==void 0&&s.identity!==void 0&&t.identity!==s.identity)return{success:!0,warning:"iOS typed text result was not verified: focus moved to another field."};let d=t.nativeEditableValues??{},c=s.nativeEditableValues??{};if(Object.keys(d).some((f)=>Object.hasOwn(c,f)&&d[f]!==c[f]&&B(n,d[f],c[f],a)))return{success:!0};if(t.value!==void 0&&s.value!==void 0&&!I(t,s))return Z(n,t.value,s.value,a);return}function te(n,t,s){if(H(t.nativeEditableValues,s.nativeEditableValues)==="changed")return{success:!0};let d=_(n,t,s);if(d!==void 0)return d;if(t.value===void 0||s.value===void 0)return{success:!0,warning:"iOS typed text result was not verified: the focused field could not be read."};if(s.value.length>=k)return{success:!0,warning:M};if(t.value===s.value)return{success:!1,error:"iOS nothing was typed: the focused field value is unchanged."};return L(s.value,n)?{success:!0}:{success:!0,warning:`iOS typed text changed in the focused field; observed value: ${JSON.stringify(s.value)}.`}}function ne(n,t,s){if(s===void 0)return"the focused field could not be read, so what was committed is unknown.";if(t?.secure||s.secure)return"the focused field is secure; its content was not inspected.";let a=D(n,t,s);if(a!==void 0)return a;if(H(t?.nativeEditableValues,s.nativeEditableValues)==="changed")return"another editable on screen changed (a recipient or token entry may hold the text), so the focused field's value does not show what was committed.";return re(n,t?.value,s.value)}function re(n,t,s){if(s!==void 0&&s.length>=k)return`the focused field's value fills the ${k}-character read window, so what was committed is unknown.`;if(t===void 0||s===void 0)return"the focused field's value could not be read, so what was committed is unknown.";if(t===s)return"the focused field's value is unchanged from before typing; entries held as separate tokens would not show in it.";return L(s,n)?"the focused field now contains the typed characters.":`the focused field's value changed to ${JSON.stringify(s)} (partial or altered input).`}function H(n={},t={}){let s=Object.keys(n).filter((a)=>Object.hasOwn(t,a));if(s.some((a)=>n[a]!==t[a]))return"changed";return s.length>0?"unchanged":"unavailable"}function L(n,t){let s=Array.from(t),a=0;for(let d of n)if(d===s[a])a++;return a===s.length}function ie(n,t){let s=es(),a=s===void 0?void 0:s-n.now();return t===void 0?a:Math.min(t,a??t)}async function Bh(n,t={},s){let a=await w5(n,t,s);return a.kind==="read"?a.field:void 0}async function w5(n,t={},s){let{observer:a,timer:d,signal:c,display:f}=n,h=me(c),m=ie(d,s);if(h?.aborted||m!==void 0&&m<=0)return{kind:"unavailable"};let p=new AbortController,b=je(h,p.signal);try{let T=await l(()=>a.execute({freshness:"fresh",skipScreenshot:!0,skipAccessibilityAudit:!0,signal:b,timeoutMs:m,...f===void 0?{}:{display:f}}),{timer:d,timeoutMs:m,signal:b,label:"iOS typed text verification",onTimeout:()=>p.abort()}),y=T.viewHierarchy;if(T.freshness?.isFresh===!1||!y||y.hierarchy.error)return{kind:"unavailable"};return{kind:"read",field:nl(y,new N,{...t,includeIosNativeEditableValues:!0}),hasFocusedTextInput:xa(y,new N),keyboardVisible:KB(T.viewHierarchy,T.screenSize)}}catch{return e.warn("[iOS typed text] Focused field read unavailable; result cannot be verified"),{kind:"unavailable"}}}var oe=1000,se=250;async function BF(n,t,s,a=!1){let{timer:d,signal:c}=s,f=typeof a==="boolean"?a:a.verifyAppend;if(t?.secure&&!f)return{...C(n,t,void 0),after:t};let h=await Bh(s,{includeIdentity:f}),m=C(n,t,h,a),p=d.now()+oe;while(!m.success&&I(t,h)&&d.now()<p)c?.throwIfAborted(),await d.sleep(se),h=await Bh(s,{includeIdentity:f},Math.max(0,p-d.now())),m=C(n,t,h,a);return{...m,after:h}}var ae=2000;async function $F(n,t,s,a){if(!WB(n))return n;let d=s?.secure?s:await Bh(a,{},ae);return`${n} Observed afterwards: ${ne(t,s,d)}`}var de=3,ue=Wt([100,200]);function ce(n,t){return Object.entries(n?.nativeEditableValues??{}).some(([s,a])=>a!==""&&t?.nativeEditableValues?.[s]==="")}function le(n){return n?.keyboardNativeEditableValue===""}function W(n,t,s=1,a){if(ce(a,n)||le(n))return{success:!0};if(n?.secure)return{success:!0,warning:"iOS clear check skipped for a secure field."};if(n?.value===void 0){if(t!==void 0)return{success:!1,partialApplication:!0,error:`iOS clear could not be verified after ${s} attempt(s); the focused field last held ${JSON.stringify(t)} and could not be read again.`};return{success:!0,warning:"iOS clear was not verified: the focused field could not be read."}}if(n.value===t)return fe(n.value,s,a?.value);return n.value===""?{success:!0}:n.value}function fe(n,t,s){if(n!==""&&n===s)return{success:!1,error:`iOS clear removed nothing after ${t} attempt(s): the runner acknowledged each clear, but the focused field still holds its pre-clear value; remaining value: ${JSON.stringify(n)}.`};return{success:!0,warning:`The field still holds ${JSON.stringify(n)} after the clear was acknowledged and retried; it may be a mask or permanent prefix at its cleared content, or the app may have refused the clear.`}}function U(n){if(n===void 0)return"unreadable";let t=Object.entries(n.nativeEditableValues??{}).map(([s,a])=>`${s}:${a.length}`);return`focusedLength=${n.value?.length??"none"} native={${t.join(",")}} keyboardEditableLength=${n.keyboardNativeEditableValue?.length??"none"}`}async function he(n,t,s){s?.throwIfAborted();let a=ue.delayForAttempt(t),d=es();if(d!==void 0&&d-n.now()<=a)return!1;await l(()=>n.sleep(a),{timer:n,signal:s,label:"iOS clear retry"}),s?.throwIfAborted();let c=es();return c===void 0||c>n.now()}async function RV({clear:n,observer:t,timer:s,signal:a,display:d}){let c=me(a),f=async(w=!1)=>{c?.throwIfAborted();let g=await Bh({observer:t,timer:s,signal:c,display:d},{iosPlaceholderAsBlank:!0});if(c?.throwIfAborted(),w&&!g?.secure&&g?.value===void 0)e.warn("[iOS clear] Pre-clear field read unavailable; using post-clear verification only");return g},h=await f(!0),m=await n();if(!m.success)return m;if(c?.throwIfAborted(),h?.secure)return{success:!0,warning:"iOS clear check skipped for a secure field."};let p=await f(),b=W(p,void 0,1,h),T=1;while(typeof b==="string"&&T<de){if(!await he(s,T,c))break;let w=await n();if(T++,!w.success)return{...w,partialApplication:!0};p=await f(),b=W(p,b,T,h)}let y=typeof b==="string"?{success:!1,partialApplication:!0,error:`iOS clear left text in the focused field after ${T} attempt(s); remaining value: ${JSON.stringify(b)}.`}:b;if(!y.success)e.warn(`[iOS clear] Verification failed; before ${U(h)}; after ${U(p)}`);return y}class R{editables=[];keyboardTop;recordKeyboard(n){if(n)this.keyboardTop=Math.min(this.keyboardTop??n.top,n.top)}recordEditable(n,t){if(t)this.editables.push({value:n,bounds:t})}soleValueAboveKeyboard(){let n=this.keyboardTop;if(n===void 0)return;let t=this.editables.filter((s)=>s.bounds.bottom<=n);return t.length===1?t[0].value:void 0}}function pe(n,t){return n!==null&&t!==null&&n.left>=t.left&&n.right<=t.right&&n.top>=t.top&&n.bottom<=t.bottom}function xe(n,t,s){let a=s.extractNodeProperties(n),d=Vt(a),c=d.textSources.text;if(!(d.className==="UIButton"||a.role==="button")||!dt(a.clickable)||d.nativeId!==void 0||c===void 0||c===""||!pe(Tt(qt(n)),t))return;return c}function ye(n,t){let s=n;for(let a of t){if(!s.startsWith(a))return;s=s.slice(a.length),s=s.startsWith(" ")?s.slice(1):s}return s}function G(n,t,s){let a=Tt(qt(n)),d=(n.node??[]).flatMap((f)=>xe(f,a,s)??[]);if(d.length===0)return;let c=t===void 0?void 0:ye(t,d);return c===void 0?{tokens:d}:{tokens:d,trailingText:c}}var UF=1000,q=50;function A(n,t){let s=t.extractWindowRootGroups(n,"topmost-first"),a=t.extractRootNodes(n),d=new Set,c=(f)=>f.filter((h)=>{if(d.has(h))return!1;return d.add(h),!0});return[...s,a].map(c).filter((f)=>f.length>0)}function be(n,t){let s=Vt(n),a=s.textSources.value??s.textSources.text,d=["android.","androidx."].some((f)=>s.className?.startsWith(f));if(!t&&LF(s.className,n["hint-text"],a))return 0;let c=typeof a==="string"?a.length:s.capturedTextLength;if(c===void 0&&d&&O(n)&&!dt(n.password))return 0;return c}function su(n,t=new K,s=!1){for(let a of A(n,t)){let d;for(let c of a)t.traverseNode(c,(f)=>{let h=t.extractNodeProperties(f),m=be(h,s);if((h.focused==="true"||h.focused===!0)&&m!==void 0)d=Math.max(d??0,m)});if(d!==void 0)return d}return}function xa(n,t=new K){for(let s of A(n,t))for(let a of s){let d=!1;if(t.traverseNode(a,(c)=>{if(d)return;let f=t.extractNodeProperties(c);if(O(f))d=!0}),d)return!0}return!1}function HF(n,t=new K){for(let s of A(n,t)){let a;for(let d of s)t.traverseNode(d,(c)=>{let f=t.extractNodeProperties(c);if(a!==void 0||!O(f))return;a=Y(f,!0)});if(a!==void 0)return a}return}function Y(n,t=!1){let s=Vt(n);if(!t&&s.nativeId===void 0&&s.bounds===void 0)return;return JSON.stringify([s.nativeId??null,s.className??null,s.bounds?.left??null,s.bounds?.top??null])}function nl(n,t=new K,s={}){for(let a of A(n,t)){let d,c=s.includeIosNativeEditableValues?{}:void 0,f=s.includeIosNativeEditableValues?new R:void 0;for(let h of a){let m,p;if(t.traverseNode(h,(b,T)=>{if(p!==void 0&&T<=p)p=void 0;let y=t.extractNodeProperties(b),w=y.class??y.className;if(p===void 0&&w==="WKWebView")p=T;if(p===void 0)ge(y,c),Fe(b,y,f);if(!O(y))return;let g=ke(b,y,s,t);if(g===void 0)return;d??=g,m??=p===void 0?Te(g,s):void 0}),m!==void 0)return m}if(c&&Object.keys(c).length>0)return ve(d,c,f);if(d!==void 0)return d}return}function Te(n,t){return t.includeIosNativeEditableValues&&!n.secure&&n.value===void 0?{...n,iosNativeValueOmitted:!0}:n}function ge(n,t){if(!t||dt(n.focused)||!z(n))return;let s=Vt(n),a=n["view-id"]??s.nativeId;if(typeof a==="string"&&a!==""){let d=typeof n.value==="string"?n.value:"";t[a]=d===n["hint-text"]?"":d}}function ve(n,t,s){let a=s?.soleValueAboveKeyboard();return{...n??{secure:!1},nativeEditableValues:t,...a===void 0?{}:{keyboardNativeEditableValue:a}}}function Fe(n,t,s){if(!s)return;if((t.class??t.className)==="UIKeyboard"){s.recordKeyboard(Tt(qt(n)));return}if(z(t)){let d=typeof t.value==="string"?t.value:"";s.recordEditable(d===t["hint-text"]?"":d,Tt(qt(n)))}}function X(n){let t=n.class??n.className;return dt(n.password)||typeof t==="string"&&t.includes("SecureTextField")}function z(n){let t=n.class??n.className;if(X(n))return!1;return n.role==="textfield"||Array.isArray(n.actions)&&n.actions.includes("set_text")||typeof t==="string"&&/UITextField|UISearchBar|UITextView/.test(t)}function Ie(n,t){let s=Vt(n),a=X(n),d=s.textSources.value??s.textSources.text??(s.capturedTextLength===0?"":void 0);if(a)return{value:d,secure:a};let c=t.iosEmptyAsBlank?j(s.textSources):t.iosPlaceholderAsBlank?s.textSources.value===void 0?void 0:j(s.textSources):d;return c!==void 0||t.includeIosNativeEditableValues?{value:c,secure:a}:void 0}function ke(n,t,s,a){let d=Ie(t,s),c=d&&s.includeIdentity?{...d,identity:Y({...t,bounds:qt(n)})}:d;if(c===void 0||c.secure)return c;let f=G(n,c.value,a);return f===void 0?c:{...c,...f}}function j(n){let t=n.value;return t===void 0||t===n["hint-text"]?"":t}function O(n){if(n.focused!=="true"&&n.focused!==!0)return!1;let t=n.class??n.className,s=typeof t==="string"&&(t.includes("SecureTextField")||_g.some((f)=>t.includes(f))),a=n.actions,d=Array.isArray(a)&&a.includes("set_text"),c=n.editable==="true"||n.editable===!0;return s||d||c}async function PV(n,t,{signal:s,onDelete:a,supportsKeyCombination:d}={}){if(s?.throwIfAborted(),await n.executeCommand(d?"shell input keycombination KEYCODE_CTRL_LEFT KEYCODE_A":"shell input keyevent KEYCODE_MOVE_END"),s?.throwIfAborted(),d){await n.executeCommand("shell input keyevent KEYCODE_DEL"),a?.(),s?.throwIfAborted();return}for(let c=0;c<t;c+=q){s?.throwIfAborted();let f=Math.min(q,t-c),h=Array(f).fill("KEYCODE_DEL").join(" ");await n.executeCommand(`shell input keyevent ${h}`),a?.(),s?.throwIfAborted()}}async function AV(n,t,s=new K){o(t);try{let a=await n();o(t);let d=a.viewHierarchy;if(a.freshness?.isFresh===!1||!d||d.hierarchy.error||!xa(d,s))return{success:!1,error:"Cannot verify key-event clear: no fresh focused editable field available"};let c=su(d,s);if(c===void 0)return{success:!1,error:"Cannot verify key-event clear: focused field text length is unreadable"};return c===0?{success:!0}:{success:!1,error:`Field was not fully cleared: ${c} UTF-16 units remain`}}catch(a){return o(t),e.warn("[ClearText] Key-event clear verification unavailable",a),{success:!1,error:`Cannot verify key-event clear: ${r(a)}`}}}class _ae extends Oe{parser;androidKeyCombinationSupported;constructor(n,t=null,s=new K,a=i){super(n,{adb:t,timer:a});this.parser=s}async execute(n,t){t?.throwIfAborted();let s=J();return s.serial("clearText"),this.observedInteraction(async(a)=>{try{switch(this.device.platform){case"android":return await s.track("androidClearText",()=>this.executeAndroidClearText(a,t));case"ios":return await s.track("iOSClearText",()=>this.executeiOSClearText(a,t));default:throw s.end(),St(this.device.platform,"clear text")}}catch(d){s.end(),t?.throwIfAborted();let c=u(d,"Failed to clear text");return e.warn(`[ClearText] ${c.message}`),{success:!1,error:c.message}}},{...Kt.textEdit,tolerancePercent:0,timeoutMs:At.immediate,progress:n,signal:t,perf:s})}get testHooks(){return{executeAndroidClearText:this.executeAndroidClearText.bind(this),executeiOSClearText:this.executeiOSClearText.bind(this)}}async executeAndroidClearText(n,t){let s=n.viewHierarchy,a=n;if(s&&!s.hierarchy.error&&!xa(s,this.parser)){let f=await this.refreshFocusedTextInputObservation(s,t).catch((h)=>{t?.throwIfAborted(),e.warn("[ClearText] Focus refresh unavailable; trying live clearing",h);return});if(f?.viewHierarchy&&!xa(f.viewHierarchy,this.parser))return{success:!1,error:"No focused editable node found"};a=f??{...n,viewHierarchy:void 0}}let d=E.getInstance(this.device,this.adbFactory);t?.throwIfAborted();let c=await d.requestClearText();if(t?.throwIfAborted(),c.success)return e.info(`[ClearText] Cleared text via accessibility service: ${c.totalTimeMs}ms`),{success:!0};return e.warn(`[ClearText] Accessibility service clear failed: ${c.error}, falling back to ADB`),this.executeAdbClearText(a,t)}async refreshFocusedTextInputObservation(n,t){let s;if(typeof n.updatedAt==="number")s=n.updatedAt+1;else{t?.throwIfAborted();let c=await this.adb.getDeviceTimestampMsWithSource();if(t?.throwIfAborted(),c.source==="host")return;s=c.source==="device-seconds"?c.timestampMs+UF:c.timestampMs}t?.throwIfAborted();let a=await this.observeScreen.execute({freshness:"fresh",minTimestamp:s,signal:t,skipScreenshot:!0});t?.throwIfAborted();let d=a.viewHierarchy;return a.freshness?.isFresh!==!1&&d&&!d.hierarchy.error?a:void 0}async executeAdbClearText(n,t){let s=n.viewHierarchy,d=(s&&!s.hierarchy.error?su(s,this.parser):void 0)??200;if(d===0)return{success:!0};return await this.clearWithDeletes(d,t),AV(()=>this.observeScreen.execute({freshness:"fresh",minTimestamp:0,signal:t,skipScreenshot:!0}),t,this.parser)}async executeiOSClearText(n,t){let s=Date.now();e.debug("[ClearText] iOS begin");try{let a=x.getInstance(this.device);t?.throwIfAborted();let c=await RV({clear:()=>{let f=es();return a.requestClearText(void 0,5000,void 0,{abortSignal:t,...f===void 0?{}:{deadlineMs:f}})},observer:this.observeScreen,timer:this.timer,signal:t});if(c.retryable!==!1)t?.throwIfAborted();if(c.success)return e.info(`[ClearText] Cleared text via CtrlProxy iOS totalMs=${Date.now()-s}`),{success:!0,..."warning"in c&&c.warning?{warnings:[c.warning]}:{}};return e.warn(`[ClearText] CtrlProxy iOS clear failed: ${c.error} totalMs=${Date.now()-s}`),{success:!1,error:c.error,...c.retryable===!1?{retryable:!1}:{}}}catch(a){return t?.throwIfAborted(),e.warn(`[ClearText] CtrlProxy iOS exception: ${r(a)} totalMs=${Date.now()-s}`,a),{success:!1,error:String(a)}}}findAnyTextInputLength(n){let t=0;for(let s of A(n,this.parser))for(let a of s)this.parser.traverseNode(a,(d)=>{let c=this.parser.extractNodeProperties(d),f=Vt(c).textSources.text;if(c.class&&_g.some((h)=>c.class.includes(h))&&f&&typeof f==="string")t=Math.max(t,f.length)});return t}async clearWithDeletes(n,t){this.androidKeyCombinationSupported??=Ut(this.adb,1000,this.timer).then((a)=>a!==null&&a>=gd).catch((a)=>{throw this.androidKeyCombinationSupported=void 0,u(a,"Failed to read Android key-combination capability")});let s=await P(this.androidKeyCombinationSupported,t);await PV(this.adb,n,{signal:t,supportsKeyCombination:s})}}
3
- export{LF,Bh,w5,BF,$F,RV,UF,su,xa,HF,nl,PV,AV,_ae};
2
+ import{He,me,J,o,P,dt,jg,wt,K,c$,Wt,u$,Ht,Pd,ns,x,E}from"./chunk-sfqe223f.js";import{i,zt,we,qt,l,e}from"./chunk-r0vp315h.js";import{Oe,jt,Tt}from"./chunk-e0870khr.js";import{r,u,Rt}from"./chunk-2b39zyxc.js";function JF(n,t,s){return["android.","androidx."].some((a)=>n?.startsWith(a))&&typeof t==="string"&&t!==""&&s===t}function F(n){return n?.tokens??[]}function S(n){return n.tokens===void 0?n.value??"":n.trailingText}function I(...n){return n.some((t)=>F(t).length>0)}function v(n){let t=F(n);return t.length===0?"no tokens":`tokens ${JSON.stringify(t)}`}function V(n,t){let s=Array.from(t),a=0;for(let d of n)if(d===s[a])a++;return a===s.length}function _(n,t,s){if(!I(t,s))return;if(F(s).length>F(t).length)return{success:!0};let a=S(t),d=S(s);if(a===void 0||d===void 0)return{success:!0,warning:"iOS typed text result was not verified: the recipient field's value does not follow its tokens."};if(a===d)return{success:!1,error:`iOS nothing was typed: no new recipient token was committed and the text after the tokens is unchanged (${v(s)}).`};return V(d,n)?{success:!0}:{success:!0,warning:`iOS typed text changed in the recipient field; text after the tokens: ${JSON.stringify(d)} (${v(s)}).`}}function D(n,t,s){if(!I(t,s))return;let a=F(t);if(F(s).length>a.length)return`a new recipient token was committed (${v(s)}).`;let c=t===void 0?"":S(t),f=S(s);if(c===void 0||f===void 0)return`the recipient field's value does not follow its tokens, so the typed text is unknown (${v(s)}).`;if(c===f)return`no new recipient token was committed and the text after the tokens is unchanged (${v(s)}).`;return V(f,n)?`the text after the recipient tokens now contains the typed characters (${v(s)}).`:`the text after the recipient tokens changed to ${JSON.stringify(f)} (partial or altered input; ${v(s)}).`}class N extends K{extractNodeProperties(n){let t=we(n),s=t.class??t.className;if(t.password===!0||t.password==="true"||typeof s==="string"&&s.includes("SecureTextField"))return{focused:t.focused,class:s,password:!0,editable:t.editable,actions:t.actions,"resource-id":t["resource-id"],bounds:t.bounds};return super.extractNodeProperties(n)}}var k=512,M=`iOS typed text result was not verified: the focused field value fills the ${k}-character read window, so a change past it cannot be seen.`;function B(n,t,s,a){let d=t.length+n.length-s.length;if(d<0||!a&&d!==0)return!1;for(let c=s.indexOf(n);c!==-1;c=s.indexOf(n,c+1)){if(s.slice(0,c)!==t.slice(0,c))return!1;if(s.slice(c+n.length)===t.slice(c+d))return!0}return!1}function Z(n,t,s,a){if(s.length===k)return{success:!0,warning:M};if(t===s)return{success:!1,error:"iOS nothing was typed: the focused field value is unchanged."};return B(n,t,s,a)?{success:!0}:{success:!1,error:"iOS typed text chunk was not fully appended to the focused field."}}function C(n,t={secure:!1},s={secure:!1},a=!1){if(t.secure||s.secure)return{success:!0,warning:"iOS typed text check skipped for a secure field."};let d=typeof a==="boolean"?a:a.verifyAppend,c=Q(t);return(d?ee(n,c,s,typeof a!=="boolean"&&a.firstChunk===!0):void 0)??te(n,c,s)}function Q(n){return n.iosNativeValueOmitted===!0&&n.value===void 0?{...n,value:""}:n}function ee(n,t,s,a){if(t.identity!==void 0&&s.identity!==void 0&&t.identity!==s.identity)return{success:!0,warning:"iOS typed text result was not verified: focus moved to another field."};let d=t.nativeEditableValues??{},c=s.nativeEditableValues??{};if(Object.keys(d).some((f)=>Object.hasOwn(c,f)&&d[f]!==c[f]&&B(n,d[f],c[f],a)))return{success:!0};if(t.value!==void 0&&s.value!==void 0&&!I(t,s))return Z(n,t.value,s.value,a);return}function te(n,t,s){if(H(t.nativeEditableValues,s.nativeEditableValues)==="changed")return{success:!0};let d=_(n,t,s);if(d!==void 0)return d;if(t.value===void 0||s.value===void 0)return{success:!0,warning:"iOS typed text result was not verified: the focused field could not be read."};if(s.value.length>=k)return{success:!0,warning:M};if(t.value===s.value)return{success:!1,error:"iOS nothing was typed: the focused field value is unchanged."};return L(s.value,n)?{success:!0}:{success:!0,warning:`iOS typed text changed in the focused field; observed value: ${JSON.stringify(s.value)}.`}}function ne(n,t,s){if(s===void 0)return"the focused field could not be read, so what was committed is unknown.";if(t?.secure||s.secure)return"the focused field is secure; its content was not inspected.";let a=D(n,t,s);if(a!==void 0)return a;if(H(t?.nativeEditableValues,s.nativeEditableValues)==="changed")return"another editable on screen changed (a recipient or token entry may hold the text), so the focused field's value does not show what was committed.";return re(n,t?.value,s.value)}function re(n,t,s){if(s!==void 0&&s.length>=k)return`the focused field's value fills the ${k}-character read window, so what was committed is unknown.`;if(t===void 0||s===void 0)return"the focused field's value could not be read, so what was committed is unknown.";if(t===s)return"the focused field's value is unchanged from before typing; entries held as separate tokens would not show in it.";return L(s,n)?"the focused field now contains the typed characters.":`the focused field's value changed to ${JSON.stringify(s)} (partial or altered input).`}function H(n={},t={}){let s=Object.keys(n).filter((a)=>Object.hasOwn(t,a));if(s.some((a)=>n[a]!==t[a]))return"changed";return s.length>0?"unchanged":"unavailable"}function L(n,t){let s=Array.from(t),a=0;for(let d of n)if(d===s[a])a++;return a===s.length}function ie(n,t){let s=ns(),a=s===void 0?void 0:s-n.now();return t===void 0?a:Math.min(t,a??t)}async function Jh(n,t={},s){let a=await F5(n,t,s);return a.kind==="read"?a.field:void 0}async function F5(n,t={},s){let{observer:a,timer:d,signal:c,display:f}=n,h=me(c),m=ie(d,s);if(h?.aborted||m!==void 0&&m<=0)return{kind:"unavailable"};let p=new AbortController,b=He(h,p.signal);try{let T=await l(()=>a.execute({freshness:"fresh",skipScreenshot:!0,skipAccessibilityAudit:!0,signal:b,timeoutMs:m,...f===void 0?{}:{display:f}}),{timer:d,timeoutMs:m,signal:b,label:"iOS typed text verification",onTimeout:()=>p.abort()}),y=T.viewHierarchy;if(T.freshness?.isFresh===!1||!y||y.hierarchy.error)return{kind:"unavailable"};return{kind:"read",field:ll(y,new N,{...t,includeIosNativeEditableValues:!0}),hasFocusedTextInput:Ma(y,new N),keyboardVisible:u$(T.viewHierarchy,T.screenSize)}}catch{return e.warn("[iOS typed text] Focused field read unavailable; result cannot be verified"),{kind:"unavailable"}}}var oe=1000,se=250;async function XF(n,t,s,a=!1){let{timer:d,signal:c}=s,f=typeof a==="boolean"?a:a.verifyAppend;if(t?.secure&&!f)return{...C(n,t,void 0),after:t};let h=await Jh(s,{includeIdentity:f}),m=C(n,t,h,a),p=d.now()+oe;while(!m.success&&I(t,h)&&d.now()<p)c?.throwIfAborted(),await d.sleep(se),h=await Jh(s,{includeIdentity:f},Math.max(0,p-d.now())),m=C(n,t,h,a);return{...m,after:h}}var ae=2000;async function ZF(n,t,s,a){if(!c$(n))return n;let d=s?.secure?s:await Jh(a,{},ae);return`${n} Observed afterwards: ${ne(t,s,d)}`}var de=3,ue=zt([100,200]);function ce(n,t){return Object.entries(n?.nativeEditableValues??{}).some(([s,a])=>a!==""&&t?.nativeEditableValues?.[s]==="")}function le(n){return n?.keyboardNativeEditableValue===""}function W(n,t,s=1,a){if(ce(a,n)||le(n))return{success:!0};if(n?.secure)return{success:!0,warning:"iOS clear check skipped for a secure field."};if(n?.value===void 0){if(t!==void 0)return{success:!1,partialApplication:!0,error:`iOS clear could not be verified after ${s} attempt(s); the focused field last held ${JSON.stringify(t)} and could not be read again.`};return{success:!0,warning:"iOS clear was not verified: the focused field could not be read."}}if(n.value===t)return fe(n.value,s,a?.value);return n.value===""?{success:!0}:n.value}function fe(n,t,s){if(n!==""&&n===s)return{success:!1,error:`iOS clear removed nothing after ${t} attempt(s): the runner acknowledged each clear, but the focused field still holds its pre-clear value; remaining value: ${JSON.stringify(n)}.`};return{success:!0,warning:`The field still holds ${JSON.stringify(n)} after the clear was acknowledged and retried; it may be a mask or permanent prefix at its cleared content, or the app may have refused the clear.`}}function U(n){if(n===void 0)return"unreadable";let t=Object.entries(n.nativeEditableValues??{}).map(([s,a])=>`${s}:${a.length}`);return`focusedLength=${n.value?.length??"none"} native={${t.join(",")}} keyboardEditableLength=${n.keyboardNativeEditableValue?.length??"none"}`}async function he(n,t,s){s?.throwIfAborted();let a=ue.delayForAttempt(t),d=ns();if(d!==void 0&&d-n.now()<=a)return!1;await l(()=>n.sleep(a),{timer:n,signal:s,label:"iOS clear retry"}),s?.throwIfAborted();let c=ns();return c===void 0||c>n.now()}async function OV({clear:n,observer:t,timer:s,signal:a,display:d}){let c=me(a),f=async(w=!1)=>{c?.throwIfAborted();let g=await Jh({observer:t,timer:s,signal:c,display:d},{iosPlaceholderAsBlank:!0});if(c?.throwIfAborted(),w&&!g?.secure&&g?.value===void 0)e.warn("[iOS clear] Pre-clear field read unavailable; using post-clear verification only");return g},h=await f(!0),m=await n();if(!m.success)return m;if(c?.throwIfAborted(),h?.secure)return{success:!0,warning:"iOS clear check skipped for a secure field."};let p=await f(),b=W(p,void 0,1,h),T=1;while(typeof b==="string"&&T<de){if(!await he(s,T,c))break;let w=await n();if(T++,!w.success)return{...w,partialApplication:!0};p=await f(),b=W(p,b,T,h)}let y=typeof b==="string"?{success:!1,partialApplication:!0,error:`iOS clear left text in the focused field after ${T} attempt(s); remaining value: ${JSON.stringify(b)}.`}:b;if(!y.success)e.warn(`[iOS clear] Verification failed; before ${U(h)}; after ${U(p)}`);return y}class R{editables=[];keyboardTop;recordKeyboard(n){if(n)this.keyboardTop=Math.min(this.keyboardTop??n.top,n.top)}recordEditable(n,t){if(t)this.editables.push({value:n,bounds:t})}soleValueAboveKeyboard(){let n=this.keyboardTop;if(n===void 0)return;let t=this.editables.filter((s)=>s.bounds.bottom<=n);return t.length===1?t[0].value:void 0}}function pe(n,t){return n!==null&&t!==null&&n.left>=t.left&&n.right<=t.right&&n.top>=t.top&&n.bottom<=t.bottom}function xe(n,t,s){let a=s.extractNodeProperties(n),d=Wt(a),c=d.textSources.text;if(!(d.className==="UIButton"||a.role==="button")||!dt(a.clickable)||d.nativeId!==void 0||c===void 0||c===""||!pe(wt(qt(n)),t))return;return c}function ye(n,t){let s=n;for(let a of t){if(!s.startsWith(a))return;s=s.slice(a.length),s=s.startsWith(" ")?s.slice(1):s}return s}function G(n,t,s){let a=wt(qt(n)),d=(n.node??[]).flatMap((f)=>xe(f,a,s)??[]);if(d.length===0)return;let c=t===void 0?void 0:ye(t,d);return c===void 0?{tokens:d}:{tokens:d,trailingText:c}}var QF=1000,q=50;function A(n,t){let s=t.extractWindowRootGroups(n,"topmost-first"),a=t.extractRootNodes(n),d=new Set,c=(f)=>f.filter((h)=>{if(d.has(h))return!1;return d.add(h),!0});return[...s,a].map(c).filter((f)=>f.length>0)}function be(n,t){let s=Wt(n),a=s.textSources.value??s.textSources.text,d=["android.","androidx."].some((f)=>s.className?.startsWith(f));if(!t&&JF(s.className,n["hint-text"],a))return 0;let c=typeof a==="string"?a.length:s.capturedTextLength;if(c===void 0&&d&&O(n)&&!dt(n.password))return 0;return c}function gu(n,t=new K,s=!1){for(let a of A(n,t)){let d;for(let c of a)t.traverseNode(c,(f)=>{let h=t.extractNodeProperties(f),m=be(h,s);if((h.focused==="true"||h.focused===!0)&&m!==void 0)d=Math.max(d??0,m)});if(d!==void 0)return d}return}function Ma(n,t=new K){for(let s of A(n,t))for(let a of s){let d=!1;if(t.traverseNode(a,(c)=>{if(d)return;let f=t.extractNodeProperties(c);if(O(f))d=!0}),d)return!0}return!1}function eL(n,t=new K){for(let s of A(n,t)){let a;for(let d of s)t.traverseNode(d,(c)=>{let f=t.extractNodeProperties(c);if(a!==void 0||!O(f))return;a=Y(f,!0)});if(a!==void 0)return a}return}function Y(n,t=!1){let s=Wt(n);if(!t&&s.nativeId===void 0&&s.bounds===void 0)return;return JSON.stringify([s.nativeId??null,s.className??null,s.bounds?.left??null,s.bounds?.top??null])}function ll(n,t=new K,s={}){for(let a of A(n,t)){let d,c=s.includeIosNativeEditableValues?{}:void 0,f=s.includeIosNativeEditableValues?new R:void 0;for(let h of a){let m,p;if(t.traverseNode(h,(b,T)=>{if(p!==void 0&&T<=p)p=void 0;let y=t.extractNodeProperties(b),w=y.class??y.className;if(p===void 0&&w==="WKWebView")p=T;if(p===void 0)ge(y,c),Fe(b,y,f);if(!O(y))return;let g=ke(b,y,s,t);if(g===void 0)return;d??=g,m??=p===void 0?Te(g,s):void 0}),m!==void 0)return m}if(c&&Object.keys(c).length>0)return ve(d,c,f);if(d!==void 0)return d}return}function Te(n,t){return t.includeIosNativeEditableValues&&!n.secure&&n.value===void 0?{...n,iosNativeValueOmitted:!0}:n}function ge(n,t){if(!t||dt(n.focused)||!z(n))return;let s=Wt(n),a=n["view-id"]??s.nativeId;if(typeof a==="string"&&a!==""){let d=typeof n.value==="string"?n.value:"";t[a]=d===n["hint-text"]?"":d}}function ve(n,t,s){let a=s?.soleValueAboveKeyboard();return{...n??{secure:!1},nativeEditableValues:t,...a===void 0?{}:{keyboardNativeEditableValue:a}}}function Fe(n,t,s){if(!s)return;if((t.class??t.className)==="UIKeyboard"){s.recordKeyboard(wt(qt(n)));return}if(z(t)){let d=typeof t.value==="string"?t.value:"";s.recordEditable(d===t["hint-text"]?"":d,wt(qt(n)))}}function X(n){let t=n.class??n.className;return dt(n.password)||typeof t==="string"&&t.includes("SecureTextField")}function z(n){let t=n.class??n.className;if(X(n))return!1;return n.role==="textfield"||Array.isArray(n.actions)&&n.actions.includes("set_text")||typeof t==="string"&&/UITextField|UISearchBar|UITextView/.test(t)}function Ie(n,t){let s=Wt(n),a=X(n),d=s.textSources.value??s.textSources.text??(s.capturedTextLength===0?"":void 0);if(a)return{value:d,secure:a};let c=t.iosEmptyAsBlank?j(s.textSources):t.iosPlaceholderAsBlank?s.textSources.value===void 0?void 0:j(s.textSources):d;return c!==void 0||t.includeIosNativeEditableValues?{value:c,secure:a}:void 0}function ke(n,t,s,a){let d=Ie(t,s),c=d&&s.includeIdentity?{...d,identity:Y({...t,bounds:qt(n)})}:d;if(c===void 0||c.secure)return c;let f=G(n,c.value,a);return f===void 0?c:{...c,...f}}function j(n){let t=n.value;return t===void 0||t===n["hint-text"]?"":t}function O(n){if(n.focused!=="true"&&n.focused!==!0)return!1;let t=n.class??n.className,s=typeof t==="string"&&(t.includes("SecureTextField")||jg.some((f)=>t.includes(f))),a=n.actions,d=Array.isArray(a)&&a.includes("set_text"),c=n.editable==="true"||n.editable===!0;return s||d||c}async function MV(n,t,{signal:s,onDelete:a,supportsKeyCombination:d}={}){if(s?.throwIfAborted(),await n.executeCommand(d?"shell input keycombination KEYCODE_CTRL_LEFT KEYCODE_A":"shell input keyevent KEYCODE_MOVE_END"),s?.throwIfAborted(),d){await n.executeCommand("shell input keyevent KEYCODE_DEL"),a?.(),s?.throwIfAborted();return}for(let c=0;c<t;c+=q){s?.throwIfAborted();let f=Math.min(q,t-c),h=Array(f).fill("KEYCODE_DEL").join(" ");await n.executeCommand(`shell input keyevent ${h}`),a?.(),s?.throwIfAborted()}}async function NV(n,t,s=new K){o(t);try{let a=await n();o(t);let d=a.viewHierarchy;if(a.freshness?.isFresh===!1||!d||d.hierarchy.error||!Ma(d,s))return{success:!1,error:"Cannot verify key-event clear: no fresh focused editable field available"};let c=gu(d,s);if(c===void 0)return{success:!1,error:"Cannot verify key-event clear: focused field text length is unreadable"};return c===0?{success:!0}:{success:!1,error:`Field was not fully cleared: ${c} UTF-16 units remain`}}catch(a){return o(t),e.warn("[ClearText] Key-event clear verification unavailable",a),{success:!1,error:`Cannot verify key-event clear: ${r(a)}`}}}class dce extends Oe{parser;androidKeyCombinationSupported;constructor(n,t=null,s=new K,a=i){super(n,{adb:t,timer:a});this.parser=s}async execute(n,t){t?.throwIfAborted();let s=J();return s.serial("clearText"),this.observedInteraction(async(a)=>{try{switch(this.device.platform){case"android":return await s.track("androidClearText",()=>this.executeAndroidClearText(a,t));case"ios":return await s.track("iOSClearText",()=>this.executeiOSClearText(a,t));default:throw s.end(),Rt(this.device.platform,"clear text")}}catch(d){s.end(),t?.throwIfAborted();let c=u(d,"Failed to clear text");return e.warn(`[ClearText] ${c.message}`),{success:!1,error:c.message}}},{...jt.textEdit,tolerancePercent:0,timeoutMs:Tt.immediate,progress:n,signal:t,perf:s})}get testHooks(){return{executeAndroidClearText:this.executeAndroidClearText.bind(this),executeiOSClearText:this.executeiOSClearText.bind(this)}}async executeAndroidClearText(n,t){let s=n.viewHierarchy,a=n;if(s&&!s.hierarchy.error&&!Ma(s,this.parser)){let f=await this.refreshFocusedTextInputObservation(s,t).catch((h)=>{t?.throwIfAborted(),e.warn("[ClearText] Focus refresh unavailable; trying live clearing",h);return});if(f?.viewHierarchy&&!Ma(f.viewHierarchy,this.parser))return{success:!1,error:"No focused editable node found"};a=f??{...n,viewHierarchy:void 0}}let d=E.getInstance(this.device,this.adbFactory);t?.throwIfAborted();let c=await d.requestClearText();if(t?.throwIfAborted(),c.success)return e.info(`[ClearText] Cleared text via accessibility service: ${c.totalTimeMs}ms`),{success:!0};return e.warn(`[ClearText] Accessibility service clear failed: ${c.error}, falling back to ADB`),this.executeAdbClearText(a,t)}async refreshFocusedTextInputObservation(n,t){let s;if(typeof n.updatedAt==="number")s=n.updatedAt+1;else{t?.throwIfAborted();let c=await this.adb.getDeviceTimestampMsWithSource();if(t?.throwIfAborted(),c.source==="host")return;s=c.source==="device-seconds"?c.timestampMs+QF:c.timestampMs}t?.throwIfAborted();let a=await this.observeScreen.execute({freshness:"fresh",minTimestamp:s,signal:t,skipScreenshot:!0});t?.throwIfAborted();let d=a.viewHierarchy;return a.freshness?.isFresh!==!1&&d&&!d.hierarchy.error?a:void 0}async executeAdbClearText(n,t){let s=n.viewHierarchy,d=(s&&!s.hierarchy.error?gu(s,this.parser):void 0)??200;if(d===0)return{success:!0};return await this.clearWithDeletes(d,t),NV(()=>this.observeScreen.execute({freshness:"fresh",minTimestamp:0,signal:t,skipScreenshot:!0}),t,this.parser)}async executeiOSClearText(n,t){let s=Date.now();e.debug("[ClearText] iOS begin");try{let a=x.getInstance(this.device);t?.throwIfAborted();let c=await OV({clear:()=>{let f=ns();return a.requestClearText(void 0,5000,void 0,{abortSignal:t,...f===void 0?{}:{deadlineMs:f}})},observer:this.observeScreen,timer:this.timer,signal:t});if(c.retryable!==!1)t?.throwIfAborted();if(c.success)return e.info(`[ClearText] Cleared text via CtrlProxy iOS totalMs=${Date.now()-s}`),{success:!0,..."warning"in c&&c.warning?{warnings:[c.warning]}:{}};return e.warn(`[ClearText] CtrlProxy iOS clear failed: ${c.error} totalMs=${Date.now()-s}`),{success:!1,error:c.error,...c.retryable===!1?{retryable:!1}:{}}}catch(a){return t?.throwIfAborted(),e.warn(`[ClearText] CtrlProxy iOS exception: ${r(a)} totalMs=${Date.now()-s}`,a),{success:!1,error:String(a)}}}findAnyTextInputLength(n){let t=0;for(let s of A(n,this.parser))for(let a of s)this.parser.traverseNode(a,(d)=>{let c=this.parser.extractNodeProperties(d),f=Wt(c).textSources.text;if(c.class&&jg.some((h)=>c.class.includes(h))&&f&&typeof f==="string")t=Math.max(t,f.length)});return t}async clearWithDeletes(n,t){this.androidKeyCombinationSupported??=Ht(this.adb,1000,this.timer).then((a)=>a!==null&&a>=Pd).catch((a)=>{throw this.androidKeyCombinationSupported=void 0,u(a,"Failed to read Android key-combination capability")});let s=await P(this.androidKeyCombinationSupported,t);await MV(this.adb,n,{signal:t,supportsKeyCombination:s})}}
3
+ export{JF,Jh,F5,XF,ZF,OV,QF,gu,Ma,eL,ll,MV,NV,dce};
4
4
 
5
- //# debugId=24BFED71E3BDBBC864756E2164756E21
5
+ //# debugId=8AA3F5591B3CA52D64756E2164756E21